scripts to automate tasks

The place to post if you need help or advice

Moderators: ChriThor, LXF moderators

scripts to automate tasks

Postby fibreshouse » Fri Apr 15, 2005 1:06 pm

I'm using synce to talk to my Ipaq but it requires various commands to setup properly.
I know that you can script these but am having problems understanding how to write a script that will send a comand as user then a second command as SU.
I know it'll be fairly simple but I'm haviong real brain fade.
Posts: 2
Joined: Fri Apr 15, 2005 12:55 pm

RE: scripts to automate tasks

Postby nelz » Fri Apr 15, 2005 1:42 pm

Code: Select all

first command
su -c "second command"

If you want to do this without it asking for the root password, you'll need to investigate sudo. man sudo gives a good explanation of how it works and the config file is well comented with examples.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Site admin
Posts: 8782
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Postby M0PHP » Fri Apr 15, 2005 7:14 pm

Make sure you make the script executable afterwards using chmod +x or by running `bash /path/to/` or something to that effect.
LXF regular
Posts: 737
Joined: Wed Apr 06, 2005 7:40 am
Location: Bishop Auckland, County Durham, UK

Return to Help!

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 5 guests