<?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: variable from remote shell in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-from-remote-shell/m-p/3643212#M239494</link>
    <description>FLAG=$(remsh Rsystem "if [ -z "string" ];then;FLAG="Y";else;FLAG="N";fi;echo $FLAG")&lt;BR /&gt;&lt;BR /&gt;Now try as,&lt;BR /&gt;&lt;BR /&gt;echo $FLAG&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;</description>
    <pubDate>Thu, 06 Oct 2005 07:55:45 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2005-10-06T07:55:45Z</dc:date>
    <item>
      <title>variable from remote shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-from-remote-shell/m-p/3643211#M239493</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt; A small questiona here, may be a silly one.&lt;BR /&gt;I am running some condition checks in remsh, For both the conditions, I need to get a variable exported to my local shell. Confused??!!!! Here is the command&lt;BR /&gt;&lt;BR /&gt;#remsh Rsystem "if [ -z "string" ];then;FLAG="Y";else;FLAG="N";fi"&lt;BR /&gt;&lt;BR /&gt;#echo $FLAG  (Yes, definitely it's going to be null).&lt;BR /&gt;&lt;BR /&gt;How can I get this value from remsh?&lt;BR /&gt;&lt;BR /&gt;TIA&lt;BR /&gt;Shahul</description>
      <pubDate>Thu, 06 Oct 2005 07:54:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-from-remote-shell/m-p/3643211#M239493</guid>
      <dc:creator>Shahul</dc:creator>
      <dc:date>2005-10-06T07:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: variable from remote shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-from-remote-shell/m-p/3643212#M239494</link>
      <description>FLAG=$(remsh Rsystem "if [ -z "string" ];then;FLAG="Y";else;FLAG="N";fi;echo $FLAG")&lt;BR /&gt;&lt;BR /&gt;Now try as,&lt;BR /&gt;&lt;BR /&gt;echo $FLAG&lt;BR /&gt;&lt;BR /&gt;hth.&lt;BR /&gt;</description>
      <pubDate>Thu, 06 Oct 2005 07:55:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-from-remote-shell/m-p/3643212#M239494</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-06T07:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: variable from remote shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-from-remote-shell/m-p/3643213#M239495</link>
      <description>Try as,&lt;BR /&gt;&lt;BR /&gt;# FLAG=$(remsh localhost -l root -n 'if [ ! -z "string" ];then FLAG="Y";else FLAG="N";fi;echo $FLAG;')&lt;BR /&gt;# echo $FLAG&lt;BR /&gt;Y&lt;BR /&gt;&lt;BR /&gt;or another way as,&lt;BR /&gt;&lt;BR /&gt;# remsh localhost -l root -n 'if [ ! -z "string" ];then FLAG="Y";else FLAG="N";fi;echo $FLAG;' | grep -w 'Y'&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Thu, 06 Oct 2005 08:00:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-from-remote-shell/m-p/3643213#M239495</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-10-06T08:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: variable from remote shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/variable-from-remote-shell/m-p/3643214#M239496</link>
      <description>I think the use of FLAG in the remote command is unnecessary because the value of FLAG is needed in the local shell, NOT in the remote shell. In other words, your local shell has to read a value printed by the remote command.&lt;BR /&gt;&lt;BR /&gt;#remsh Rsystem 'if [ -z "string" ]; then; echo Y; else; echo N; fi' | read FLAG&lt;BR /&gt;#echo $FLAG&lt;BR /&gt;&lt;BR /&gt;Or, as others wrote:&lt;BR /&gt;&lt;BR /&gt;#FLAG=$(remsh Rsystem 'if [ -z "string" ]; then; echo Y; else; echo N; fi')&lt;BR /&gt;#echo $FLAG&lt;BR /&gt;&lt;BR /&gt;P.D: the first one doesn't work on BASH shell.</description>
      <pubDate>Thu, 06 Oct 2005 10:34:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/variable-from-remote-shell/m-p/3643214#M239496</guid>
      <dc:creator>CAS_2</dc:creator>
      <dc:date>2005-10-06T10:34:33Z</dc:date>
    </item>
  </channel>
</rss>

