![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| How to run a script as different user inside cronjob in solaris. | csg_user | SUN Solaris | 11 | 12-15-2007 06:49 PM |
| Non-interactive user switch to root | stevefox | Shell Programming and Scripting | 5 | 11-20-2007 08:08 PM |
| script with more then one switch | Del33t | Shell Programming and Scripting | 3 | 08-29-2007 02:07 AM |
| sql inside a script | kotasateesh | Shell Programming and Scripting | 4 | 04-26-2006 01:30 PM |
| how to find Script file location inside script | asami | Shell Programming and Scripting | 10 | 03-15-2006 12:57 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
switch user inside a script
Hi,
I wrote a unix script that will perform differnt tasks on bahalf of number of users. I use "sudo" to run the script. The problem is when I execute the command: su - user -c "xxx " > output_file, I get the system output header frm the su command. Is there a way to get rid of it instdead of doing further manipulation? Can I direct this to "null" device while the regular output will go the correct output file? |
|
||||
|
I am using "sudo" to run the script, and inside the script I use "su" several times. Each "su -user -c" to execute a certain command, and capture the log in a logfile. I would like to avoid having the system message (as a result of su) in the logfile.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|