Peter Hunkeler wrote:
To run commands in a "su" shell environment, you have to write all the commands into a UNIX file first, and then call "su" by redirecting stdin to that UNIX file.
echo "id" > /tmp/sucommandfile
su < /tmp/sucommandfile
The manual has examples of executing commands via su without redirection
like this:
To run the /usr/lib/backupall script under the admin user ID and return
to the parent shell environment when the script completes:
|su admin /usr/lib/backupall|
To run a remove shell command under the admin user ID and return to the
parent shell environment when the command completes:
|su admin -c "rm -rf /tmp/"
|
Alan
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN