![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with csh script | rahulrathod | Shell Programming and Scripting | 4 | 02-21-2008 12:38 PM |
| script problem | tdavenpo | Shell Programming and Scripting | 3 | 01-04-2006 04:07 PM |
| Problem starting a script from a 'main'-script | Rakker | UNIX for Dummies Questions & Answers | 3 | 06-28-2005 09:12 AM |
| problem with a script | Lestat | Shell Programming and Scripting | 4 | 06-13-2005 01:30 PM |
| problem with ftp script...please help | vancouver_joe | UNIX for Advanced & Expert Users | 2 | 11-22-2001 07:47 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Help. Script problem
hey guys. i have a bunch of programs in a script that needs to run as root and the rest as another user, we'll call him gabriel.
now, in this script, i want to run the first few lines as root. now, how do i, after running as root, tell the script to run the remaining lines as the user gabriel? the script is set up a lil something like this. and this is just an example who uptime vmstat -s 2 4 su - gabriel <=== is this the right way to tell the script to run the below commands as user gabriel? ls -l /var/tmp cat /var/tmp/getlost |
|
||||
|
Quote:
so basically your saying the below will work? (keep in mind, this is all running from a file, not the command line) who uptime vmstat -s 2 4 sudo -u gabriel \ ls -l /var/tmp;\ cat /var/tmp/getlost |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|