shell脚本(查看多台服务器端口)
生活随笔
收集整理的這篇文章主要介紹了
shell脚本(查看多台服务器端口)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
【xcall.sh】
#!/bin/bash
params=$@
hosts=`cat /soft/hadoop/etc/hadoop/slaves`
tput setaf 2
? ? ?echo =============localhost==================
? ? ?tput setaf 7
? ? ?$params
for host in $hosts ; do
? ? ?tput setaf 2
? ? ?echo =============$host===========================
? ? ?tput setaf 7
? ? ?ssh -4 $host "source /etc/profile ; $params"
done
轉載于:https://blog.51cto.com/13088442/1943670
總結
以上是生活随笔為你收集整理的shell脚本(查看多台服务器端口)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Go简单的Goroutine示例
- 下一篇: 小学期学习记录(一)