How to run terminal commands on startup?

slazareth

macrumors regular
Original poster
Feb 5, 2006
124
1
Hey, I was wondering how I could run a terminal command on startup. The command needs to be run as a super user too.

Here's the command I need to run.

Code:
/Applications/xampp/xamppfiles/mampp start
Any pointers to a tutorial or anything would be awesome! Thanks!
 

yippy

macrumors 68020
Mar 14, 2004
2,087
3
Chicago, IL
It shouldn't be to hard. What you need to do is save the command as a plane text file. Then remove the extension and give the file execute permissions (done with chmod command in terminal I believe). Then just put this file in your startup items under System Preferences->User->you->Startup Items
 

slazareth

macrumors regular
Original poster
Feb 5, 2006
124
1
Hey, thanks for the help. That makes sense to me but I don't exactly know how to do it. I'm not terribly hot in terminal. I can follow instructions and can bounce around through directories, but that's about it.
 

yippy

macrumors 68020
Mar 14, 2004
2,087
3
Chicago, IL
Well, unfortunately, the key step is one that I am not sure how to do. I did it once before and have forgotten how to properly bless a file as executable.

That said, I think I can do one better. I have a couple of the executable text files already made. All I have to do is open it in text edit, change the commands, save and it will still work.

The attached zip file should be the file you need to put in your startup items. If you ever want to change it or make another, just duplicate the file and modify it like I said above.
 

Attachments