Add "not" to if statement in shell script
- by John Crawford
I have the following script that should exist if the user does not exist.
#check if user currently exists on system
if id $User > /dev/null 2>&1
then
#user exists no need to exit program
echo "blah blah, what a waste of space"
else
echo "This user does NOT exists. Please create that user before using this script.\n"
exit…