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

Doman

macrumors newbie
Original poster
Dec 7, 2009
2
0
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 -> Script.sh
chmod +x Script.sh
(Doesn't double click to run ~ opens in TextEdit)

I open terminal and type sh Script.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?
Thanks,
Doman
 
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.
 
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 "mycommand.sh" with the above two details.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.