bash で fifo を読み込もうとしています。エラーが発生するのはなぜですか?
pipe="./$1"
trap "rm -f $pipe" EXIT
if [[ ! -p $pipe ]]; then
mkfifo $pipe
fi
while true
do
if read line <$pipe; then
if "$line" == 'exit' || "$line" == 'EXIT' ; then
break
elif ["$line" == 'yes']; then
echo "YES"
else
echo $line
fi
fi
done
echo "Reader exiting"
私が得るエラー:
./sh.sh: line 12: [: missing `]' ./sh.sh: line 14: [HelloWorld: command not found
他のシェルから実行して印刷する場合HelloWorld