shell脚本(查看多台服务器端口)

前端之家收集整理的这篇文章主要介绍了shell脚本(查看多台服务器端口)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


@H_404_2@

【xcall.sh】@H_404_2@

#!/bin/bash@H_404_2@

params=$@@H_404_2@

hosts=`cat /soft/hadoop/etc/hadoop/slaves`@H_404_2@

tput setaf 2@H_404_2@

echo =============localhost==================@H_404_2@

tput setaf 7@H_404_2@

$params@H_404_2@

for host in $hosts ; do@H_404_2@

tput setaf 2@H_404_2@

echo =============$host=========================== @H_404_2@

tput setaf 7@H_404_2@

ssh -4 $host "source /etc/profile ; $params"@H_404_2@

done@H_404_2@

猜你在找的Bash相关文章