In OS X 10.9.5
I wrote a Shell Script (via vim). Save it and navigate to this script and
sh code.sh
it runs perfect (in iTerm & Total Terminal).
The same command in the same directory produces via Mac Automator always an ERROR. Why?
in Automator and in Terminal.echo $SHELL
/bin/bash
Why is it impossible to run a shellscript via Automator.
Instead of entering commands and waiting for a response, you can compose shell scripts that run without direct interaction. A shell script is a text file that contains one or more UNIX commands.
Bash scripts are files containing code that tell your computer to do something. They're a staple of the Linux world, and there are thousands of them freely available on the internet. With a bit of tweaking, you can use these scripts on your Mac, too.
This problem can be solved by adding the following code above your current code:
export PATH=/usr/local/bin:$PATH
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With