Mac Terminal / .sh app


macrumors newbie
Original poster
Dec 7, 2009
Hey, I recently got a command line program because I'm too much of a broke college student to pay for anything with a GUI and I want to automate this a bit. Here's what I've done.

Save As ->
chmod +x
(Doesn't double click to run ~ opens in TextEdit)

I open terminal and type sh
It runs.
How do I get it to just run?

When the script calls for sudo, I imagine I just get a prompt. Then after that I need it to enter in information once it opens the application.
The automated equivalence of:
Program> set status=on
Program> set loader=active
Program> set buffer=10
Program> quit

Echo doesn't work, so I'm lost. Any ideas?


macrumors 6502
Apr 24, 2008
Add #!/bin/sh as the first line of your script. That way, it becomes a "standalone executable". As to the function of your script, I don't quite grasp what you're trying to accomplish. If you're trying to automate some other existing application, maybe you need to look into AppleScript.


macrumors 68000
Sep 10, 2008
Asheville, NC
ditto on the "#!/bin/sh" in the first line. Also, don't forget to "chmod +x". Honestly, I've never done the ".command" thing. I just do "" with the above two details.

Similar threads

Register on MacRumors! This sidebar will go away, and you'll see fewer ads.