Page 1 of 1

Shellscript exited with non-successful status code: 2

PostPosted: Sat Apr 01, 2017 5:15 pm
by pdoak
I am trying to execute this shell script on a matched file:

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.

Re: Shellscript exited with non-successful status code: 2

PostPosted: Mon Apr 03, 2017 10:14 am
by Mr_Noodle
Not sure if this is the problem but right off the bat I see that you need to use double quotes around $1. If the path has any spaces in it, it will cause problems.

Otherwise, you'll have to check the man pages of each command you use to see what the error codes are.

Re: Shellscript exited with non-successful status code: 2

PostPosted: Wed Apr 05, 2017 10:19 am
by pdoak
Thanks Mr_Noodle. I will change that.

I found the problem though. The hazel rule had been imported and was pointing to the wrong shell.