running bash scripts in mac’s terminal

It works like running a .bat file on Windows, but there are a couple of things to keep in mind:

The file has to be executable. Let’s say it’s called myscript.sh. Here’s how you’d make it executable:

chmod +x myscript.sh

Then, if you want to run it from the same directory that you’re in, you have to specify the current directory, like this:

./myscript.sh

Nice explanation from notjustjay in this macrumors forum thread.

Advertisements
This entry was posted in tech notes and tools and tagged , . Bookmark the permalink.