i am trying to do something like this :
#!/bin/ksh
# Change to the userid user1
su - user1
#Issue the command to change directory and list files
cd /home/user1/
ls -lrt
exit #Come out of the user1 to root again
#change to user 2
su - user2
cd /home/user2/
ls -lrt
exit #back to root again
#come out of the script
done # Is this needed?
Trying to execute this as root ( with appropriate permissions) however only the first line executes. Where am i going wrong?
Thanks