Making batch commands in Terminal

Started by aeria., March 14, 2010, 10:38:02 PM

Previous topic - Next topic
For some reason, I shall post this quick tutorial for the people who are interested.

As most Windows users know, you can batch commands and save it as a batch file. It's as easy as writing them in notepad and then save it was the .bat extention. For Mac users, it's almost the same thing, however this is a bit more work involved in this process. Here's an example:

Ok so I use the Mac version of MAME. It's a multi-arcade emulator (it runs practically every arcade game known to man) that has been ported to OSX, however there has never been a working front-end (an interface) for me Only the bare minimum files. The only way I've been able to run it is if I go to Terminal and type in the following:
cd /Applications/mame/
*Press Enter*
./mame
*Press Enter*

I love simplicity so I don't want to manually type that in every single time. I'd rather double click something so that I go right into a game.

Here's how to I would make a "batch" command of that so that it will be easier.

Open up TextEdit, type in your commands. Keep different commands separated. So in text edit I would simply type it in:

cd /Applications/mame/
./mame

After that, save it without any file extention to the main directory (Macintosh HD). To do this, delete it from the Get Info Panel if you right click the file and open "Get Info"

From there, open up Terminal and type in:

chmod 777 /mame

This will convert it to something you can execute (double click to open). With that said, you're done! With the example shown here, I can now do two commands by opening this new file, like any other app. While this may be useless for most (most won't even get what I just did) it can be proven useful to others.


#TYBG

this is interesting and i am sure terminal is a great help to.....idk hackers, but does terminal actually help speed up the process of getting to a location. Surely, making a shortcut or an alias is faster than doing a terminal command. idk


"Were bigger than Jesus!"  -John Lennon