<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script help (while, pipe and remsh&amp;quot; in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803531#M82489</link>
    <description>remsh $x -n ll $y $z"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
    <pubDate>Tue, 10 Sep 2002 17:32:40 GMT</pubDate>
    <dc:creator>harry d brown jr</dc:creator>
    <dc:date>2002-09-10T17:32:40Z</dc:date>
    <item>
      <title>Script help (while, pipe and remsh"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803528#M82486</link>
      <description>Gurus,&lt;BR /&gt;&lt;BR /&gt;I need some help with the following script. I have a file "a" with the following syntax -&lt;BR /&gt;hostA  fileA1  fileA2&lt;BR /&gt;hostB  fileB1  fileB2&lt;BR /&gt;hostC  fileC1  fileC2&lt;BR /&gt;(... and so on)&lt;BR /&gt;&lt;BR /&gt;I want to read this file (one line at a time)and check the existence of files in respective hosts. The script, I am using is -&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;cat a|while read x y z&lt;BR /&gt;do&lt;BR /&gt;remsh $a "ll $y $z"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;The problem is that the script is reading just first line of the file "a" and never goes further. If I replace remsh command with echo (say, echo $x, $y, $z), all line of file "a" are read.&lt;BR /&gt;&lt;BR /&gt;What do I need to make the script work? I am puzzled because echo works but remsh stops after reading first line. (And yes, I do have remsh capability as that user on all hosts listed in file "a")&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;...Manjeet&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Sep 2002 17:19:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803528#M82486</guid>
      <dc:creator>Kellogg Unix Team</dc:creator>
      <dc:date>2002-09-10T17:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Script help (while, pipe and remsh"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803529#M82487</link>
      <description>&lt;BR /&gt;WHAT is $a set too??&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 10 Sep 2002 17:26:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803529#M82487</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-09-10T17:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Script help (while, pipe and remsh"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803530#M82488</link>
      <description>Manjeet,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Replace "remsh $a" with "remsh $a -n".&lt;BR /&gt;&lt;BR /&gt;Hai</description>
      <pubDate>Tue, 10 Sep 2002 17:31:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803530#M82488</guid>
      <dc:creator>Hai Nguyen_1</dc:creator>
      <dc:date>2002-09-10T17:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: Script help (while, pipe and remsh"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803531#M82489</link>
      <description>remsh $x -n ll $y $z"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 10 Sep 2002 17:32:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803531#M82489</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-09-10T17:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script help (while, pipe and remsh"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803532#M82490</link>
      <description>Hi Manjeet,&lt;BR /&gt;&lt;BR /&gt;It looks like you are reading the contents of file 'a' into variables x, y, and z.  Shouldn't your 'remsh' line read:&lt;BR /&gt;&lt;BR /&gt;remsh $x "ll $y $z"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;JP&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Sep 2002 17:33:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803532#M82490</guid>
      <dc:creator>John Poff</dc:creator>
      <dc:date>2002-09-10T17:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Script help (while, pipe and remsh"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803533#M82491</link>
      <description>I ran into this a while back and the "-n" is required when running remsh in a loop. The -n option redirects standard input to remsh from /dev/null&lt;BR /&gt;&lt;BR /&gt;Ray</description>
      <pubDate>Tue, 10 Sep 2002 17:38:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803533#M82491</guid>
      <dc:creator>Ray Brewer</dc:creator>
      <dc:date>2002-09-10T17:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: Script help (while, pipe and remsh"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803534#M82492</link>
      <description>To expand on my previous reply, here is what the man page on remsh says about the "-n" option and why it is required&lt;BR /&gt;&lt;BR /&gt;By default, remsh reads its standard input and sends it to the remote command because remsh has no way to determine whether the remote command requires input.  The -n option redirects standard input to remsh from /dev/null. This is useful when running a shell script containing a remsh command, since otherwise remsh may use input not intended for it. The -n option is also useful when running remsh in the background from a job control shell, /usr/bin/csh or /usr/bin/ksh. Otherwise, remsh stops and waits for input from the terminal keyboard for the remote command.  /usr/bin/sh automatically redirects its input from /dev/null when jobs are run in the background.</description>
      <pubDate>Tue, 10 Sep 2002 17:44:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803534#M82492</guid>
      <dc:creator>Ray Brewer</dc:creator>
      <dc:date>2002-09-10T17:44:16Z</dc:date>
    </item>
    <item>
      <title>Re: Script help (while, pipe and remsh"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803535#M82493</link>
      <description>Thanks to all for correctly pointing out correct usage of remsh (remsh -n). That did the trick! And thanks for pointing out the typo ! Yes it was "remsh $x "ll $y $z" and not "remsh $a ..." as put in my original post. (I wish there is edit button to edit my first post !!)&lt;BR /&gt;&lt;BR /&gt;Thanks again!</description>
      <pubDate>Tue, 10 Sep 2002 17:46:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803535#M82493</guid>
      <dc:creator>Kellogg Unix Team</dc:creator>
      <dc:date>2002-09-10T17:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: Script help (while, pipe and remsh"</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803536#M82494</link>
      <description>Ignore that last quote in my past post. cut and paste this:&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;cat a|while read x y z&lt;BR /&gt;do&lt;BR /&gt;remsh $x -n "ll $y $z"&lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Tue, 10 Sep 2002 18:08:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-help-while-pipe-and-remsh-quot/m-p/2803536#M82494</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-09-10T18:08:02Z</dc:date>
    </item>
  </channel>
</rss>

