Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Shellscript from Mac Automator

In OS X 10.9.5

I wrote a Shell Script (via vim). Save it and navigate to this script and

sh code.shit 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. enter image description here

like image 500
Teletubbi-OS X Avatar asked Aug 06 '14 12:08

Teletubbi-OS X


People also ask

Can we do shell scripting in Mac?

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.

Do bash scripts work on Mac?

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.


1 Answers

This problem can be solved by adding the following code above your current code:

export PATH=/usr/local/bin:$PATH
like image 194
Lucademicus Avatar answered Sep 23 '22 12:09

Lucademicus