The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 01-25-2008
RTM's Avatar
RTM RTM is offline
Hog Hunter
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
If $cmd is where you are running the command as root, change it to
su - sasia -c "$cmd"

Test it to see if it is what you need and read the man page on su command.
Reply With Quote