Hey Guys,
I've been studying Linux for several months now and am trying to get my head around bash scripting.
I'm playing around with a simple script that will echo one thing if it's run by a particular user and will echo something else if run by another user again..
I've got this so far:
Code:
!/bin/bash
if [[ $EUID -eq 0 ]]; then
echo "root"
if [[ $EUID -eq 500 ]]; then
echo "jon"
else
exit 1
fi
fi
The UID for jon is 500 and of course root is 0... in theory I'm sure this should work.. but maybe my syntax is wrong?
Any help would be appreciated.
Thanks
Jon