I've got a handful of servers which have a log file I'd like to monitor. Because the project is new and most of the errors so far have been unique, I'd like to monitor these logs manually for a while. I was hoping to save a little bit of time by putting all of the IPs to monitor in a text file, then doing something simple like:
#!/bin/bash while read ip; do scp user@"$ip":/var/log/file.log ./ nano -w file.log rm -f file.log done < ips.txt
However, Nano (and Vi) absolutely flip out, as it appears the Bash loop does not wait for me to exit them before continuing on to the next command.
How do I make the Bash loop wait for me to exit the text editor before continuing? Feel free to be technical in explaining the answer; part of the reason I'm asking is because I don't know enough about Bash to know why this is happening, but I'd like to.