ping -c N(次数) IP_addr >/tmp/ping.txt
mail -c "user1@host2 user3@host3....."
zhenzongjian 发表于 2012-1-30 22:36
#!/bin/ksh
echo "Enter IP"
read IP
ping -c 10 $IP |tee /tmp/ping.txt
echo "Enter mail addres. [username@hostname [[example]]user1@host2 user3@host3.....]"
read addres
mail $addres
对BZ的命令做成了脚本,需要输入IP和用户。
顺便提下 mail -c "" 貌似是抄送命令 不加发送用户的话 貌似发不出去。
PS:echo 那行因为回帖版面问题换行了。。。。