Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

scripts to automate tasks

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help!
View previous topic :: View next topic  
Author Message
fibreshouse



Joined: Fri Apr 15, 2005 1:55 pm
Posts: 2

PostPosted: Fri Apr 15, 2005 2:06 pm    Post subject: scripts to automate tasks Reply with quote

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
View user's profile Send private message
nelz
Site admin


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8449
Location: Warrington, UK

PostPosted: Fri Apr 15, 2005 2:42 pm    Post subject: RE: scripts to automate tasks Reply with quote

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.
_________________
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
Back to top
View user's profile Send private message
M0PHP
LXF regular


Joined: Wed Apr 06, 2005 8:40 am
Posts: 737
Location: Bishop Auckland, County Durham, UK

PostPosted: Fri Apr 15, 2005 8:14 pm    Post subject: Reply with quote

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 user's profile Send private message Visit poster's website
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Help! All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast