I have a script that automatically converts excel file from xls to csv using unoconv. From time to time I'm getting this error.
line 174: 21023 Segmentation fault unoconv -f csv "$FILES"
I want to be able to handle any error that occurs upon conversion. I've tried adding this to the script.
unoconv -f csv "$FILES"
if [ $? -ne 0 ]; then
echo "error encountered when converting from xls to csv"
else
echo "Successfully converted to csv"
fi
My problem is that. Even if I encounter that error. The error message is not being reflected. Is there anything I'm doing wrong?
try something like: