this is a bash script. im getting the error in the if statement line
# 2. read a line of input from the keyboard
read answer
if [-z "$answer"]
then
$answer=$default
else
$default=$answer
fi
i don’t do much bash anymore, i can’t see the error, ive tried
if [-z "$answer"]; then
and that failed as well with the same error. can anyone else see the error?
EDIT UPDATE
i changed it to this
read answer
if [ -z "$answer" ]
then
$answer=$defaultEntry
else
$defaultEntry=$answer
fi
and the same error occures
simply leave spaces between the brackets and condition: