-1

enter image description here

I have error (command not found). so what is the easy solution and explanation for this error?

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232

1 Answers1

0

It looks like you're using a single-brace implementation of test, but missing the whitespace that is required. You probably have something like

echo "Is it morning? Please answer yes or no"
read var
if ["$var" == "yes"]; then
    something
else
    something else
fi

The problem is that spaces are required inside of the braces, thus:

if [ "$var" == "yes" ]; then

For more details on the syntax, read the manual page for test with the command man test.

DopeGhoti
  • 76,081