us-pata
asked on
if then else fi - error with folder exists
My script causes error:
without argument
# ./scriptname
#: line 9: syntax error near unexpected token `else'
#: line 9: `else'
with argument i get the same
anyone know what im doing wrong?
without argument
# ./scriptname
#: line 9: syntax error near unexpected token `else'
#: line 9: `else'
with argument i get the same
anyone know what im doing wrong?
# $1 = wanted username
if [ "$1" ] then
if [ -d /home/$1 ]; then
echo "User exists..."
else
echo "do stuff"
fi
else
echo "Missing"
fi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER