#!/bin/bashfile=$(find ‘你要找的起始位置’ -type f )for num in $filedoif [ -f $num ];then grep '你要查找的字符' $num && echo $num fidone
(1)首先,把要传输的主机ip保存到文件内 vi ip 10.161.4.x10.161.4.x10.161.4.x(2)编写脚本#!/usr/bin/kshusername=tomcat #这里是连接远程主机的用户名,本例中连接的远程主机用户名都一样#echo $usernamepassword='xxxxx'
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号