simple shell script not running

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

simple shell script not running 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
Chuggett
 
Posts: 30
Joined: Wed Mar 16, 2011 9:17 pm

Re: simple shell script not running Mon Dec 12, 2011 3:31 pm • by Mr_Noodle
Can you post what the logs say?
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: simple shell script not running 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
Chuggett
 
Posts: 30
Joined: Wed Mar 16, 2011 9:17 pm

Re: simple shell script not running 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.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: simple shell script not running 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
Chuggett
 
Posts: 30
Joined: Wed Mar 16, 2011 9:17 pm

Re: simple shell script not running 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.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: simple shell script not running Wed Dec 14, 2011 4:16 pm • by Chuggett
ahhhhh...perfect. that now works. Thanks so much Mr Noodle.
Chuggett
 
Posts: 30
Joined: Wed Mar 16, 2011 9:17 pm


Return to Support