• Re: ssh in a loop

    From Esau Laguna@21:1/5 to All on Sun Oct 9 11:02:46 2022
    El jueves, 19 de noviembre de 2020 a la(s) 05:59:32 UTC-6, JasonJames HisWife escribió:
    On Friday, October 24, 2003 at 12:00:14 PM UTC-7, Adam Selene wrote:
    "Dan Mercer" <[email protected]> wrote in message news:1Pbmb.70116$[email protected]...

    "Adam Selene" <[email protected]> wrote in message
    news:[email protected]...
    : 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
    do
    ssh -n -t myuserid@$line $1
    done <machines.list >>~/output.txt
    clear
    less >>~/output.txt

    Or you could pipe the results directly to less:
    while read line
    do
    ssh -n -t myuserid@$line $1
    done <machines.list |less

    Dan Mercer's the other one of the street to do it again soon and I will be in your area tomorrow morning 🌅🌄 the office and they told her that this stuff is in manual testing profile picture is of experience with the link 🔗 firebase and I
    hope to hear from you soon thank 📱❤️ [email protected] ❤️ KJ ❤️ KJ ❤️ JJ ❤️ Kylie Jenner Jason James ❤️ Kylie Jenner Jason James ❤️ Kylie Jenner Jason James ❤️ Kylie Jenner Jason James ❤️ Kylie Jenner Jason
    James and His Lawyer's office today so much for all the information ℹ️ ℹ️ the hospital 🏥❤️ Kylie Jenner Jason James ❤️ Kylie Jenner Jason James ❤️ Kylie and I can 🥫🥫 you can get it Again 😁 and again I apologise and again
    thank you so very happy with the link 🔗 firebase I can 🥫 and called the mechanic 🧰 the hospital 🏥❤️ JJ ❤️ Kylie Jenner Jason James ❤️ Keep Updated resume enclosed the details of experience in manual testing resume enclosed my CV
    attached herewith is called me enough names of the street to get anything done ✅

    : done
    : clear
    : less /home/myuserid/output.txt
    :
    : The contents of machines.list is:
    :
    : proxy-01.mydomain.com
    : proxy-02.mydomain.com
    : proxy-03.mydomain.com
    : proxy-04.mydomain.com
    : proxy-05.mydomain.com
    :
    : When I run the script it grabs the output from the first machine in the
    list
    : but goes no further. What am I doing wrong here?
    :
    :
    : Thanks in advance,
    :
    : Adam
    :
    :


    Thank you! The -n is just what I needed.

    Thanks again,
    Adam
    https://groups.google.com/g/comp.unix.shell/c/POLBma_q7FI/m/ez_CzcDFBAAJ

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Esau Laguna@21:1/5 to All on Sun Oct 9 11:01:42 2022
    El jueves, 19 de noviembre de 2020 a la(s) 05:59:32 UTC-6, JasonJames HisWife escribió:
    On Friday, October 24, 2003 at 12:00:14 PM UTC-7, Adam Selene wrote:
    "Dan Mercer" <[email protected]> wrote in message news:1Pbmb.70116$[email protected]...

    "Adam Selene" <[email protected]> wrote in message
    news:[email protected]...
    : 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
    do
    ssh -n -t myuserid@$line $1
    done <machines.list >>~/output.txt
    clear
    less >>~/output.txt

    Or you could pipe the results directly to less:
    while read line
    do
    ssh -n -t myuserid@$line $1
    done <machines.list |less

    Dan Mercer's the other one of the street to do it again soon and I will be in your area tomorrow morning 🌅🌄 the office and they told her that this stuff is in manual testing profile picture is of experience with the link 🔗 firebase and I
    hope to hear from you soon thank 📱❤️ [email protected] ❤️ KJ ❤️ KJ ❤️ JJ ❤️ Kylie Jenner Jason James ❤️ Kylie Jenner Jason James ❤️ Kylie Jenner Jason James ❤️ Kylie Jenner Jason James ❤️ Kylie Jenner
    Jason James and His Lawyer's office today so much for all the information ℹ️ ℹ️ the hospital 🏥❤️ Kylie Jenner Jason James ❤️ Kylie Jenner Jason James ❤️ Kylie and I can 🥫🥫 you can get it Again 😁 and again I apologise and
    again thank you so very happy with the link 🔗 firebase I can 🥫 and called the mechanic 🧰 the hospital 🏥❤️ JJ ❤️ Kylie Jenner Jason James ❤️ Keep Updated resume enclosed the details of experience in manual testing resume enclosed
    my CV attached herewith is called me enough names of the street to get anything done ✅

    : done
    : clear
    : less /home/myuserid/output.txt
    :
    : The contents of machines.list is:
    :
    : proxy-01.mydomain.com
    : proxy-02.mydomain.com
    : proxy-03.mydomain.com
    : proxy-04.mydomain.com
    : proxy-05.mydomain.com
    :
    : When I run the script it grabs the output from the first machine in the
    list
    : but goes no further. What am I doing wrong here?
    :
    :
    : Thanks in advance,
    :
    : Adam
    :
    :


    Thank you! The -n is just what I needed.

    Thanks again,
    Adam
    Josue esau laguna gamez

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David W. Hodgins@21:1/5 to Esau Laguna on Sun Oct 9 17:14:28 2022
    On Sun, 09 Oct 2022 14:01:42 -0400, Esau Laguna <[email protected]> wrote:

    El jueves, 19 de noviembre de 2020 a la(s) 05:59:32 UTC-6, JasonJames HisWife escribió:
    On Friday, October 24, 2003 at 12:00:14 PM UTC-7, Adam Selene wrote:
    "Dan Mercer" <[email protected]> wrote in message
    news:1Pbmb.70116$[email protected]...

    Please learn to look at the dates. You're following up to a 2 year old message that was a follow up to a 7 year old message.

    I know google groups wants to make it look like this is a google group, but it's
    usenet news group that google copies, poorly.

    Regards, Dave Hodgins

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Janis Papanagnou@21:1/5 to David W. Hodgins on Sun Oct 9 23:39:22 2022
    On 09.10.2022 23:14, David W. Hodgins wrote:
    On Sun, 09 Oct 2022 14:01:42 -0400, Esau Laguna <[email protected]> wrote:

    El jueves, 19 de noviembre de 2020 a la(s) 05:59:32 UTC-6, JasonJames
    HisWife escribió:
    On Friday, October 24, 2003 at 12:00:14 PM UTC-7, Adam Selene wrote:
    "Dan Mercer" <[email protected]> wrote in message
    news:1Pbmb.70116$[email protected]...

    Please learn to look at the dates. You're following up to a 2 year old message
    that was a follow up to a 7 year old message.

    ITYM; "a follow up to a 17 year old message."

    Janis

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From David W. Hodgins@21:1/5 to Janis Papanagnou on Sun Oct 9 18:47:35 2022
    On Sun, 09 Oct 2022 17:39:22 -0400, Janis Papanagnou <[email protected]> wrote:

    On 09.10.2022 23:14, David W. Hodgins wrote:
    On Sun, 09 Oct 2022 14:01:42 -0400, Esau Laguna <[email protected]>
    wrote:

    El jueves, 19 de noviembre de 2020 a la(s) 05:59:32 UTC-6, JasonJames
    HisWife escribió:
    On Friday, October 24, 2003 at 12:00:14 PM UTC-7, Adam Selene wrote:
    "Dan Mercer" <[email protected]> wrote in message
    news:1Pbmb.70116$[email protected]...

    Please learn to look at the dates. You're following up to a 2 year old
    message
    that was a follow up to a 7 year old message.

    ITYM; "a follow up to a 17 year old message."

    Lol. Yep.

    Regards, Dave Hodgins

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)