Author |
Message |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: Fri Nov 21, 2008 4:12 pm Post subject: 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.
code: |
cd desktop/TextGenerator
perl sentenceGeneratorV2.pl
|
I need that code to be executed in the terminal. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Fri Nov 21, 2008 7:24 pm Post subject: 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. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
md
![](http://compsci.ca/v3/uploads/user_avatars/1849317514ed6c4399768d.png)
|
Posted: Fri Nov 21, 2008 7:30 pm Post subject: RE:batch files for mac? |
|
|
Or even more correctly shell scripting since it's a script that runs in a shell
something like code: | #!/bin/bash
cd ~/desktop/TextGenerator
perl sentenceGeneratorV2.pl
|
should probably do it |
|
|
|
|
![](images/spacer.gif) |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: Sat Nov 22, 2008 7:19 am Post subject: RE:batch files for mac? |
|
|
But what do I save it as? Text files, obviously, open in a text editor. |
|
|
|
|
![](images/spacer.gif) |
wtd
|
Posted: Sun Nov 23, 2008 1:37 pm Post subject: 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. |
|
|
|
|
![](images/spacer.gif) |
|