1、接收linuxshell控制臺輸入的字符串參數(shù):
3、接收linuxshell控制臺輸入的時間參數(shù):
#!/bash/bin
parameter=$1
if [ $parameter = "a" ];then
echo "equals"
elif [ $parameter = "b" ];then
echo "not"
else
echo "kong"
fi
2、接收linuxshell控制臺輸入的數(shù)字參數(shù):#!/bash/bin
parameter=$1
if [ $parameter = 1 ];then
echo "input is $parameter"
elif [ $parameter = 2 ];then
echo "input is $parameter"
else
echo "input is other: $parameter"
fi
3、接收linuxshell控制臺輸入的時間參數(shù):