#!/bin/bash
a=$1
if [ $a ] #判断$1是否为空
then #非空
echo "the input is: $a"
else #空
echo "input a int:"
read a
case $a in
"1")
echo "your input is $a"
;;
"2")
echo "your input is $a"
;;
*)
echo "dont know"
;;
esac
fi
时间: 2024-10-05 06:05:36