发布网友 发布时间:2022-04-26 21:58
共5个回答
热心网友 时间:2022-04-18 21:02
#!/bin.bash改成#!bin/bash,然后如下示:
#!/bin/bash
echo 'Please input number'
read number
if [ $number == 1 ];then
echo 'your number is 1'
elif [ $number == 2 ];then
echo 'your number is 2'
elif [ $number == 3 ];then
echo 'your number is 3'
else
echo 'your number is not'
fi
热心网友 时间:2022-04-18 22:20
#!/bin/sh
echo 'Please input number'
read number
if [ $number == 1 ];then
echo 'your number is 1'
elif [$number == 2 ];then
echo 'your number is 2'
elif [$number == 3 ];then
echo 'your number is 3'
else
echo 'your number is not'
fi
热心网友 时间:2022-04-18 23:54
如果用这个==比较,可以这样"$number" == "1"。
热心网友 时间:2022-04-19 01:46
判断的语句换成
${number} -eq "1"
热心网友 时间:2022-04-19 03:54
elif后面没有空格?