Mac Terminal / .sh app

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
 

Sander

macrumors 6502
Apr 24, 2008
480
7
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.
 

Detrius

macrumors 68000
Sep 10, 2008
1,621
19
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 "mycommand.sh" with the above two details.
 

Similar threads

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