Page 1 of 1

simple shell script not running

PostPosted: Sat Dec 10, 2011 9:06 am
by Chuggett
Im trying to run a shell script from Hazel. The command im using works fine in terminal, but from Hazel it returns a Fail.

/bin/sh
/Applications/Subler/SublerCLI -t {Rating:PG} -o "$1"; done

Can anyone please advise where im going wrong. Im almost certain this was working 2 months ago, then i my hard drive crashed and i have to re-do, many Hazel commands.

Thanks
Chris

Re: simple shell script not running

PostPosted: Mon Dec 12, 2011 3:31 pm
by Mr_Noodle
Can you post what the logs say?

Re: simple shell script not running

PostPosted: Tue Dec 13, 2011 8:16 am
by Chuggett
The Hazel Log Says


2011-12-13 23:15:01.924 (null)[0] Happy Birthday.m4v: Rule Set Classification with Subler matched.
/var/folders/xp/xp6M2RasFlOyVXBS4p-0+k+++TI/-Tmp-/hazelfolderwatch-5322: line 1: syntax error near unexpected token `done'
/var/folders/xp/xp6M2RasFlOyVXBS4p-0+k+++TI/-Tmp-/hazelfolderwatch-5322: line 1: `/Applications/Subler/SublerCLI -t {Rating:PG} -o "$1"; done'
2011-12-13 23:15:01.991 hazelfolderwatch[5322] [Error] Shell script failed: Error processing shell script on file /Users/iMac/Downloads/__Downloading/_Extracted/Happy Birthday.m4v.

Thanks
Chris

Re: simple shell script not running

PostPosted: Tue Dec 13, 2011 3:09 pm
by Mr_Noodle
Wait, is the /bin/sh the first line in the script? That line is not needed. You just need to make sure the "shell" specified is /bin/sh.

Re: simple shell script not running

PostPosted: Tue Dec 13, 2011 4:29 pm
by Chuggett
Yes. the /bin/sh is not in the line of code and is in the shell box above the code box.

Image

thanks

Re: simple shell script not running

PostPosted: Wed Dec 14, 2011 3:01 pm
by Mr_Noodle
Oh, I should've noticed this before. Get rid of the "done" at the end. You aren't using a loop so the "done" there is out of place.

Re: simple shell script not running

PostPosted: Wed Dec 14, 2011 4:16 pm
by Chuggett
ahhhhh...perfect. that now works. Thanks so much Mr Noodle.