我在执行以下bash脚本时遇到问题:
#!/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
可能出现的错误是什么?
答案 0 :(得分:0)
你的while和if语句间隔错误。
while [ "$response" != "q" ]; do etc
括号和双引号之间需要一个空格。