!/bin/sh!/bin/shif [ $# -ne 1 ];then echo “USAGE:/bin/sh $0 ARG1” exit 1fi for n in 8 31 41do echo “======172.16.1.$n======” ssh 172.16.1.$n “$1”done执行结果: 因cat 后面还有参数,所以需要用引号把它们括起来,形成一个整体传给 ssh_commend.sh。