私はシェルスクリプトを学んでおり、変数の入力を取得したい
mynum
私のスクリプトが機能していません:
#!/bin/bash
mynum
echo -n "Please enter the number to validate--->"
read mynum
if [ mynum -eq 100 ]
then
echo "mynum is equal to 100"
else
echo "mynum is not equal to 100"
fi
これで私を助けてください。
ついにできた !!!
#!/bin/bash
read -p "Please enter the number to validate :" mynum
#mynum=234
if [ $mynum -eq 100 ]
then
echo "mynum is equal to 100"
else
echo "mynum is not equal to 100"
fi
./is
Please enter the number to validate :345
mynum is not equal to 100