Hi Payal–
The concept is the same, the execution is just a bit different.
You need to start your file with a thing called a shebang (?sp) and the name of the binary that you want to use. I assume you’re going to want to use bash (most macs run bash at the terminal):
#!/bin/bash
Enter a blank line, and then enter the commands that you wish to execute, and then put a blank line at the end of the file.
Save it without an extension.
You then need to make the file executable (flip the executable bit). Go to the command line and type
chmod 777
and then drag your batch file and drop it onto the terminal and hit enter. 777 is probably not the best set of permissions, but it will get the job done. if you get an error that says you don’t have permission to perform that action, hit the up arrow, left arrow back to the end of the line and add the word sudo to the command:
sudo chmod 777 <yourfile>
You will be prompted for your password, enter it, and then the command should complete.
Then, to run it go to terminal and type:
./path/to/your/file
Again, you can drag the file onto terminal to avoid typing the path
Hope this helps.
Allen
PS If you want to see some help on the commands, just type
man <commandName>
in terminal to get the “man(ual) pages” for a given command