bash user input if

前端 未结 5 1139
没有蜡笔的小新
没有蜡笔的小新 2020-12-25 12:54

I am tring to do simple

Do you want to do that? [Y,n] _

question in bash.

i tried

echo \"Do that? [Y,n]\"
read DO_T         


        
5条回答
  •  时光取名叫无心
    2020-12-25 13:11

    You need to put a blank Space between "if" and the variable:

    if [ $var == "y" ]; then echo "ese era el problema" fi

提交回复
热议问题