Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

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!
 
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
 
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.
 
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

  • startup script.zip
    207 bytes · Views: 810
This will allow everyone to execute that file.

Code:
chmod ugo+x filename
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.