Hi,

        Here's my script:

#!/bin/sh

su -m -c "echo User: $(whoami)" user1
sleep1
user=$(whoami)
echo "User: $user"

        I expect that when I run this as root, it changes to user1, executes 
the 
command specified and outputs to STDOUT "User: user1", and then executes the 
second command and outputs "User: root".  That's not what's happening.  What 
happens 
is that the first echo looks like "User: " and the second looks like "User: 
root".  
What am I doing wrong?  Why doesn't whoami output anything after I su to user1? 
 Thanks.

-- 
VR ~
        TW
        Email: [EMAIL PROTECTED]
        "Knowledge Is Power"


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to