2016-04-04 12 views
0

は、私は、次のbashスクリプトを実行するとのトラブルを抱えています:ALSObashスクリプト場合としながら、条件

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

!/bin/bash 
response="x" 

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

可能性のあるエラーとは何だろうか?

答えて

0

while文とif文の間隔が間違っています。

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

ブラケットと二重引用符の間にはスペースが必要です。

+0

ありがとうございました!これは私の最後の手段だった、私は何が間違っていたかを調べようと約2時間を費やした。 – MahaRaja

関連する問題