Hey everyone,
I'm relatively new to scripting so forgive me if there's a simple solution that I'm overlooking.
I've got to do a bunch of work this weekend that involves transferring a file to a number of servers (I'll probably use scp) then ssh'ing into each server and running the script. There's ~50 servers that I'd need to do this to, so rather than doing all the manual work... well isn't that what a script is for?
My initial idea was to have all off the servers in a csv file (or a file w/ each server on a new line... esv?) which would be used as a bash for a for loop, which would read each line, store it as a variable, then run the commands w/ that variable.
I'm thinking that this wouldn't work as well as I hope though because of the prompts for scp/ssh. In the past I've done this with a simple expect script, but I've never wrote one to use the contents of a csv.
Would it be worth it to look into doing this using BASH or is an expect script the way to go?
Thanks!
[link][6 comments]