Hi,
I'm trying to write an if statement that will check the USER parm against some text but I'm not quite sure how to use the or switch in the statement.. Can anyone help me out?...
If someone could also let me know when to use ( or [ in the statement.. Can never figure that out...
if (( $USER != "user1" || "user2" || "user3" || "user4" ))
then
print ""
print "Incorrect username passed in"
print ""
print "Please check the spelling of $USER..."
print ""
exit 1
fi
All (, ((, [ and [[ have different meanings. You'll find their descriptions in your shell man pages.
I suppose you're looking for the case construct (see scottn's post above).