<?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: remsh break the while loop in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-break-the-while-loop/m-p/4003466#M297619</link>
    <description>Hi Jose:&lt;BR /&gt;&lt;BR /&gt;You need to add the '-n' switch:&lt;BR /&gt;&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;remsh hostname1 -n date&lt;BR /&gt;done &amp;lt; /tmp/test&lt;BR /&gt;&lt;BR /&gt;Notice that I eliminated the extra 'cat' process and performed the read directly.&lt;BR /&gt;&lt;BR /&gt;The 'remsh' manpages note that, "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."&lt;BR /&gt;&lt;BR /&gt;Hence the behavior you see.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Sun, 20 May 2007 12:23:22 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2007-05-20T12:23:22Z</dc:date>
    <item>
      <title>remsh break the while loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-break-the-while-loop/m-p/4003465#M297618</link>
      <description>I working with posix shell and trying to run remsh &lt;BR /&gt;command in a while loop but the while loop break after&lt;BR /&gt;the first iteration of the loop .&lt;BR /&gt;&lt;BR /&gt;Any idea why it happen ?&lt;BR /&gt;&lt;BR /&gt;System is HPUX11.11&lt;BR /&gt;&lt;BR /&gt;For example :&lt;BR /&gt;&lt;BR /&gt;Assume I have 3 lines in /tmp/test&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/test&lt;BR /&gt;line1&lt;BR /&gt;line2&lt;BR /&gt;line3&lt;BR /&gt;&lt;BR /&gt;#cat /tmp/test  | while read line&lt;BR /&gt;&amp;gt;do&lt;BR /&gt;&amp;gt;remsh hostname1 date&lt;BR /&gt;&amp;gt;done&lt;BR /&gt;Thu May 17 14:03:43 IST 2007&lt;BR /&gt;&lt;BR /&gt;if the other hand if I'm running the date command on local machine (not via remsh )&lt;BR /&gt;it runs the loop 3 times as expected .&lt;BR /&gt;&lt;BR /&gt;# cat /tmp/test  | while read line&lt;BR /&gt;&amp;gt; do&lt;BR /&gt;&amp;gt; date&lt;BR /&gt;&amp;gt; done&lt;BR /&gt;Sun May 20 23:25:54 METDST 2007&lt;BR /&gt;Sun May 20 23:25:54 METDST 2007&lt;BR /&gt;Sun May 20 23:25:54 METDST 2007&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks for any reply&lt;BR /&gt;&lt;BR /&gt;Jose&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 20 May 2007 09:42:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-break-the-while-loop/m-p/4003465#M297618</guid>
      <dc:creator>jose-kl</dc:creator>
      <dc:date>2007-05-20T09:42:56Z</dc:date>
    </item>
    <item>
      <title>Re: remsh break the while loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-break-the-while-loop/m-p/4003466#M297619</link>
      <description>Hi Jose:&lt;BR /&gt;&lt;BR /&gt;You need to add the '-n' switch:&lt;BR /&gt;&lt;BR /&gt;while read line&lt;BR /&gt;do&lt;BR /&gt;remsh hostname1 -n date&lt;BR /&gt;done &amp;lt; /tmp/test&lt;BR /&gt;&lt;BR /&gt;Notice that I eliminated the extra 'cat' process and performed the read directly.&lt;BR /&gt;&lt;BR /&gt;The 'remsh' manpages note that, "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."&lt;BR /&gt;&lt;BR /&gt;Hence the behavior you see.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Sun, 20 May 2007 12:23:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-break-the-while-loop/m-p/4003466#M297619</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-05-20T12:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: remsh break the while loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-break-the-while-loop/m-p/4003467#M297620</link>
      <description>&lt;!--!*#--&gt;Your example doesn't show any use of $line, was that while-loop really needed?  (Perhaps the name of each host?)&lt;BR /&gt;&lt;BR /&gt;Note if the size of the file "test" is small, you can also use a for-loop:&lt;BR /&gt;for line in $(&amp;lt; /tmp/test ); do&lt;BR /&gt;  remsh hostname1 -n date&lt;BR /&gt;done</description>
      <pubDate>Sun, 20 May 2007 16:55:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-break-the-while-loop/m-p/4003467#M297620</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-05-20T16:55:00Z</dc:date>
    </item>
    <item>
      <title>Re: remsh break the while loop</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/remsh-break-the-while-loop/m-p/4003468#M297621</link>
      <description>Hello James,&lt;BR /&gt;&lt;BR /&gt;Great.&lt;BR /&gt;&lt;BR /&gt;I add the "-n" and it work fine .&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Jose</description>
      <pubDate>Mon, 21 May 2007 01:20:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/remsh-break-the-while-loop/m-p/4003468#M297621</guid>
      <dc:creator>jose-kl</dc:creator>
      <dc:date>2007-05-21T01:20:59Z</dc:date>
    </item>
  </channel>
</rss>

