: I am trying to write a script that will collect output from a list of
: machines on my network. To accomplish this I have setup ssh keys and have
: written a simple loop. The only problem is my script does not go through
: the entire iteration of all the machines, just the first one it grabs during
: read. Here is my code:
: cat machines.list |while read line ;
Useless Use of cat followed by a useless semi-colon
: ssh -t myuserid@$line $1 >> /home/myuserid/output.txt
Stdin for the process is the pipe from cat. SSH inherits stdin and
empties it. use the -n option
while read line
Or you could pipe the results directly to less:
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.