最近需要做一个实时统计网络情况并统计误包率的脚本,下面是StackExchange上的一个剽窃,虽然不完全满足,但只可以输出一些信息 #!/bin/bash host=$ if [ -z $host ]; then echo "Usage: `basename $0` [HOST]" exit fi while :; do result=` -c $host | grep 'bytes from '` ]; then echo -e "`date +'%Y/%m/%d %H:…
判断网络主机存活企业面试题4:写一个脚本,实现判断10.0.0.0/24网络里,当前在线用户的IP有哪些(方法有很多) #!/bin/sh#[ -f /etc/init.d/functions ] && . /etc/init.d/functionsfunction IP_count(){ for n in 10.0.0.{0..255} do IP_check=`nmap -sP $n|grep "Host is up"|wc -l` if [ ${…
1. shell 的$! ,$?, $$,$@ $n $1 the first parameter,$2 the second... $# The number of command-line parameters. $0 The name of current program. $? Last command or function's return value. $$ The program's PID. $! …
http://blog.chinaunix.net/uid-7553302-id-183648.html 1 shell 的$! ,$?, $$,$@ $n $1 the first parameter,$2 the second... $# The number of command-line parameters. $0 The name of current program. $? Last command or function'…