
-----------------------------------
Insectoid
Fri Nov 21, 2008 4:12 pm

batch files for mac?
-----------------------------------
Any mac users out there know how to write a script that will automatically run through the terminal on a mac? Similar to a batch file on Windows. I need it to execute when you click the icon, so no need to type into the terminal (working on a program in Perl, I want the script to navigate to the correct folder, then execute the perl script.

ex.

cd desktop/TextGenerator
perl sentenceGeneratorV2.pl


I need that code to be executed in the terminal.

-----------------------------------
Tony
Fri Nov 21, 2008 7:24 pm

RE:batch files for mac?
-----------------------------------
the term is bash scripting and it's the same as on any other *nix system running bash for it's shell.

-----------------------------------
md
Fri Nov 21, 2008 7:30 pm

RE:batch files for mac?
-----------------------------------
Or even more correctly shell scripting since it's a script that runs in a shell ;-)

something like#!/bin/bash
cd ~/desktop/TextGenerator
perl sentenceGeneratorV2.pl


should probably do it

-----------------------------------
Insectoid
Sat Nov 22, 2008 7:19 am

RE:batch files for mac?
-----------------------------------
But what do I save it as? Text files, obviously, open in a text editor.

-----------------------------------
wtd
Sun Nov 23, 2008 1:37 pm

RE:batch files for mac?
-----------------------------------
It doesn't really matter what extension you give it.  This isn't Windows.  But, if you want to do so, use the standard file extension for a Unix shell file.

I leave that to your research capabilities to find out.
