I'm running the following script to compare string values to a regexp:
for entry in $(lpinfo -v | cut -c 1-); do
if [$entry == socket://*]
then
echo "blah"
continue
fi
done
Whenever I run it, each token of lpinfo is being interpreted as a command and I get errors such as:
[network: command not found
[socket: command not found
How can I get bash to interpret this as just a string comparison and not me trying to call tons of undefined functions?
Any help is much appreciated.