Guest User

Untitled

a guest
Apr 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. #Write a shell script that takes in three parameters: a search pattern, a glob file-path pattern and a file with a list of server hostnames. It #then searches for the search pattern (arg 1) in the paths specified (arg 2) on all servers specified in the file (arg 3). You can assume that ssh #keys are setup to provide password-less SSH access to all the listed servers
  4.  
  5. while read SERVER
  6. do
  7. ssh "$SERVER" /bin/sh -s <<"EOF"
  8. find "$3 -name $2"
  9. EOF
  10. done < $4
Add Comment
Please, Sign In to add comment