位置環(huán)境變量
num1=$1
num2=$2
sum=$(($num1+$num2))
echo $sum
預(yù)定義變量
echo "para is : $*"
echo "para is : $@"
echo "para num: $#"
for i in "$*"
do
echo "The parameters are: $i"
done
for i in "$@"
do
echo "The parameters are: $i"
done
echo "Current : $$"
find / -name hello.sh &
echo "background : $!"
*后臺(tái)進(jìn)程號(hào)$!未實(shí)現(xiàn)
read語句
read -p "please input your name: " -t 3 name
echo $name
read -p "please input your password: " -s passwd
echo -e "\n"
echo $passwd
read -p "please input your sex [M/F]: " -n 1 sex
echo -e "\n"
echo $sex
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者