标签: bash shell
if [ $USER=root ]; then echo "hi" else echo "bye" fi
它给了我以下错误
line 5: syntax error near unexpected token `fi' line 5: `fi'
答案 0 :(得分:1)
正确的代码: if [ $USER == "root" ]; then echo "hi; else echo "bye"; fi
if [ $USER == "root" ]; then echo "hi; else echo "bye"; fi