| View previous topic :: View next topic |
| Author |
Message |
fibreshouse
Joined: Fri Apr 15, 2005 1:55 pm Posts: 2
|
Posted: Fri Apr 15, 2005 2:06 pm Post subject: scripts to automate tasks |
|
|
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. |
|
| Back to top |
|
 |
nelz Moderator

Joined: Mon Apr 04, 2005 12:52 pm Posts: 7997 Location: Warrington, UK
|
Posted: Fri Apr 15, 2005 2:42 pm Post subject: RE: scripts to automate tasks |
|
|
| Code: |
#!/bin/sh
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. _________________ Unix is user-friendly. It's just very selective about who it's friends are. |
|
| Back to top |
|
 |
M0PHP LXF regular

Joined: Wed Apr 06, 2005 8:40 am Posts: 737 Location: Bishop Auckland, County Durham, UK
|
Posted: Fri Apr 15, 2005 8:14 pm Post subject: |
|
|
| Make sure you make the script executable afterwards using chmod +x or by running `bash /path/to/script.sh` or something to that effect. |
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|