Quantcast
Channel: linuxadmin: Expanding Linux SysAdmin knowledge
Viewing all articles
Browse latest Browse all 17761

Redirect all command line output, not just results

$
0
0

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?

submitted by linuxphoney
[link][11 comments]

Viewing all articles
Browse latest Browse all 17761

Trending Articles