0
试图阅读bash中的fifo。为什么我会得到错误?为什么在阅读shell中的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
你什么错误? – chepner 2012-07-30 13:33:30