#!/bin/bash
port=$(nmap -sT 127.0.0.1|grep tcp |grep mysql |awk '{print $2}')if["$port"=="open"]
then
echo "$(date) mysql is ok !"else/etc/init.d/mysqld restart &>/dev/null
echo "wrong"
fi
case
#!/bin/bash
echo "you want to shanghai.please input 1"
read -t 30-p "choise:" cho
case"$cho" in
"1")
echo "shanghai ready";;"2")
echo "beijing ready";;
esac
for
#!/bin/bash
for i in 12345do
echo $i
done
cd /home/hzhw/sh
ls *.sh > ls.log
y=1for i in $(cat ls.log)do
echo $y
y=$(($y+1))
done
s=0for(( i=1;i<=10;i=i+1))do
s=$(($s+$i))
done
echo "$s"