Shellscript exited with non-successful status code: 2

I am trying to execute this shell script on a matched file:
I don't understand what is wrong with this script as it runs perfectly in a bash file. The log just says that the script exited with non-succesful status code :2
Can anyone shed any light on why this doesn't work.
- Code: Select all
file=$1
sed -e 's/"Symbol"/"_Symbol"/' -e 's/\//_/g' $file > $file.tmp && mv $file.tmp $file
sort -u -o $file $file
I don't understand what is wrong with this script as it runs perfectly in a bash file. The log just says that the script exited with non-succesful status code :2
Can anyone shed any light on why this doesn't work.