Quote:
Originally Posted by igor012
Hello,
Code:
#test if the current is root or empty and stops if so.
if [ -z $XUSR ] ; then
exit 0
elif [ $XUSR = "root" ] ; then
exit 0
fi
|
Not 100% sure what the question means, but here you have it set to exit when you are root. Also, if you are logging in as a non-root user and then 'sudo -s'ing or 'su -'ing, the return value of w will be the user you had logged in as, not root.