0
我想听一个管道,并写下这段代码,但我得到了模糊的重定向错误,为什么?为什么在这里得到模糊重定向的错误?
pipe = "./$1"
# trap enables to execute a command when a signal is sent to your script
trap "rm -f $pipe" EXIT
if [[ ! -p $pipe ]]; then
mkfifo $pipe
fi
while true
do
if read line <$pipe; then
if ["$line" == 'EXIT' -o "$line" == 'exit' ]; then
break
else
echo $line
fi
fi
done