当前位置: 技术问答>linux和unix
linux shell简单问题
来源: 互联网 发布时间:2016-09-29
本文导语: echo 'install libevent ? (y/n)' && read libevent if [ ${libevent} = "y" ] then fi 请问这个代码有错误吗?我每次运行都是下面这样 install libevent ? (y/n) y ': not a valid identifierbevent sql.sh: line 10: syntax error: unexpected end of ...
echo 'install libevent ? (y/n)' && read libevent
if [ ${libevent} = "y" ]
then
fi
请问这个代码有错误吗?我每次运行都是下面这样
install libevent ? (y/n)
y
': not a valid identifierbevent
sql.sh: line 10: syntax error: unexpected end of file
请大家帮忙看看O(∩_∩)O~
if [ ${libevent} = "y" ]
then
fi
请问这个代码有错误吗?我每次运行都是下面这样
install libevent ? (y/n)
y
': not a valid identifierbevent
sql.sh: line 10: syntax error: unexpected end of file
请大家帮忙看看O(∩_∩)O~
|
sh -x sql.sh看下是哪步有问题
|
then
:
fi
:
fi
|
加echo "" 明明就可以! 你别用中文标点!
[root@CentOS tmp]# cat test.sh
#!/bin/sh
echo 'install libevent ? (y/n)' && read libevent
if [ ${libevent} = "y" ]
then
echo ""
fi
[root@CentOS tmp]# ./test.sh
install libevent ? (y/n)
y