The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.unix.shell
From: "Dan Mercer" <dmer...@mn.rr.com>
Date: Fri, 24 Oct 2003 15:46:05 GMT
Local: Fri, Oct 24 2003 11:46 am
Subject: Re: ssh in a loop
: Hello,
: : 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: : : #!/usr/local/bin/bash : : cat machines.list |while read line ; Useless Use of cat followed by a useless semi-colon : do : 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: Dan Mercer : done 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.
| ||||||||||||||