!/esr/bin/env sh #注釋
read -p "請輸入整數(shù):" num #語法
if [ "$num" -gt 16 ] #判斷
then
echo "你輸入的大于 16"
fi
echo "faq"
#語法
!/usr/bin/env sh
read -p "請輸入y" yn
if [ "$yn" == "y" ]
then
echo "運(yùn)行"
else
echo "停止"
fi
!/usr/bin/env sh
ps -ef | grep vsftpd |grep -v "grep"
if [ "$?" -eq 0 ];then
echo 'vsftpd正在運(yùn)行'
else
echo '沒有運(yùn)行'
fi
#過濾端口的語法
!/usr/bin/env sh
n=0
while [ "n
let n++
echo $n
let n++
echo "暫停"
done
#循環(huán)判斷語法
!/usr/bin/env sh
read -p "請輸入一個數(shù)字" num
if [ num" -gt 18 ]
then
echo '大于18'
elif [ "$num" -lt 18 ]
then
echo '小于18'
fi
~