So I'm running an ssh into a lot of systems and I need to redirect everything I see on the screen to a file, not just the results. So, for example, if I run:
for i in `less serverlist`; do ssh $i uname>>output; done
I will get a file that is a list of uname results.
for i in `less serverlist`; do ssh $i uname; done>>output
Gives me a list of hostnames and unames. that's fine, but on the screen I also occasionally get things like password calls and notices (like a hostname not existing and me needing to reset my password, etc) and I want all that as well. In fact, that's sort of all i want, since what I'm really looking for here is a list of servers that I do NOT have access to.
Any idea how I work that?
[link][11 comments]