0

I am having trouble with executing the following bash script:

#!/bin/bash
response=" "
while ["$response" != "q"]; do
echo -n "Please enter a response"; read response
done

ALSO

!/bin/bash
response="x"

if ["$response" = "x"]
then
echo "the value is x"
fi

What could the possible errors be?

MahaRaja
  • 1
  • 1

1 Answers1

0

Your while and if statements are spaced wrong.

while [ "$response" != "q" ]; do etc 

You need a space between the bracket and the double quote.

Doug
  • 3,472
  • 3
  • 21
  • 18
  • Thank you good sir! this was my last resort, I spent about 2 hours trying to figure what was wrong. – MahaRaja Apr 04 '16 at 01:01