I can't figure out what is wrong
if [ "$confirm_reply" = "$noinput" ]
then
echo "No CS4 user name was entered"
else
user_name=$confirm_reply
home_directory="/u/$user_name"
if ["$user_name" = "$( cat /home/reedk/ulist|cut -fl -d':'|grep $user_name)"]
then
echo "CS4 User name already used"
else
echo "Home Directory is: $home_directory"
echo "CS4 User ID is: $user_name"
= (one equal sign) is for variable assignment
== (two equal signs) is for comparisonInstead of this:
if [ "$confirm_reply" = "$noinput" ]
try this:
if [ "$confirm_reply" == "$noinput" ]
Let me know if this doesn't fix your problem.
nails, it doesn't matter whether its "=" or "==". $ a="a" $ b="a" $ [ "$a" = "$b" ] $ [ "$a" = "$b" ] && echo "same" same $ [ "$a" == "$b" ] && echo "same" same
@OP, you left out your if/fi block.... if [ ... ] fi <----------- left this out.every "if" you make needs a closing "fi".
Yes (14) | ![]() | |
No (14) | ![]() | |
I don't know (15) | ![]() |