<?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 Getting remote variables more efficiently in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-remote-variables-more-efficiently/m-p/4660175#M677489</link>
    <description>&lt;!--!*#--&gt;Hello all,&lt;BR /&gt;&lt;BR /&gt;I have a script that has to get variables remotely. Rather than having the script login to the remote server 3 separate times, is there a faster way to get each variable?&lt;BR /&gt;&lt;BR /&gt;CODE&lt;BR /&gt;--------------------------------------------------------------------&lt;BR /&gt;##Server comes from input or list##&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;CHKINSTALL=`ssh server "swlist | grep -i program" | grep -v Running | awk '{print $1}'`&lt;BR /&gt;CHKVERSION=`ssh server "swlist | grep -i program" | grep -v Running | awk '{print $2}'`&lt;BR /&gt;CFEPROCESS=`ssh server "ps -ef | grep -i program &amp;gt; /dev/null ; echo $?" | grep -v -e grep -e Running`</description>
    <pubDate>Mon, 12 Jul 2010 15:15:08 GMT</pubDate>
    <dc:creator>Patrick Ware_1</dc:creator>
    <dc:date>2010-07-12T15:15:08Z</dc:date>
    <item>
      <title>Getting remote variables more efficiently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-remote-variables-more-efficiently/m-p/4660175#M677489</link>
      <description>&lt;!--!*#--&gt;Hello all,&lt;BR /&gt;&lt;BR /&gt;I have a script that has to get variables remotely. Rather than having the script login to the remote server 3 separate times, is there a faster way to get each variable?&lt;BR /&gt;&lt;BR /&gt;CODE&lt;BR /&gt;--------------------------------------------------------------------&lt;BR /&gt;##Server comes from input or list##&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;CHKINSTALL=`ssh server "swlist | grep -i program" | grep -v Running | awk '{print $1}'`&lt;BR /&gt;CHKVERSION=`ssh server "swlist | grep -i program" | grep -v Running | awk '{print $2}'`&lt;BR /&gt;CFEPROCESS=`ssh server "ps -ef | grep -i program &amp;gt; /dev/null ; echo $?" | grep -v -e grep -e Running`</description>
      <pubDate>Mon, 12 Jul 2010 15:15:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-remote-variables-more-efficiently/m-p/4660175#M677489</guid>
      <dc:creator>Patrick Ware_1</dc:creator>
      <dc:date>2010-07-12T15:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: Getting remote variables more efficiently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-remote-variables-more-efficiently/m-p/4660176#M677490</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Perhaps (by example):&lt;BR /&gt;&lt;BR /&gt;# ssh myserver -n 'MODEL=$(model);HOST=$(echo $(hostname));UNAME=$(uname -a);echo "${MODEL}:${HOST}:${UNAME}"'&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Mon, 12 Jul 2010 15:45:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-remote-variables-more-efficiently/m-p/4660176#M677490</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-07-12T15:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: Getting remote variables more efficiently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-remote-variables-more-efficiently/m-p/4660177#M677491</link>
      <description>Variables (shells such as ksh and HP's POSIX sh) can hold megabytes of data. Put everything in one variable and then parse locally at memory speeds:&lt;BR /&gt; &lt;BR /&gt;SWLISTOUT=$(ssh server /usr/sbin/swlist)&lt;BR /&gt;CHKINSTALL=$(echo "$SWLISTOUT" | grep -i program | grep -v Running | awk '{print $1}')&lt;BR /&gt;CHKVERSION=$(echo "$SWLISTOUT" | grep -i program | grep -v Running | awk '{print $2}')&lt;BR /&gt;&lt;BR /&gt;Grave accents `` are obsolete and deprecated in the man pages. Use $(command...) instead.&lt;BR /&gt; &lt;BR /&gt;ps|grep is full of mistakes. Use ps to locate programs by name using the UNIX95 variable to activate -C and -o features:&lt;BR /&gt;&lt;BR /&gt;CFEPROCESS=$(ssh server UNIX95=1 ps -C program -o pid= -oargs=)</description>
      <pubDate>Tue, 13 Jul 2010 01:23:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-remote-variables-more-efficiently/m-p/4660177#M677491</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2010-07-13T01:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Getting remote variables more efficiently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-remote-variables-more-efficiently/m-p/4660178#M677492</link>
      <description>&lt;!--!*#--&gt;Thanks for the replies.&lt;BR /&gt;&lt;BR /&gt;-------------------------------------------&lt;BR /&gt;CFEPROCESS=$(ssh server UNIX95=1 ps -C program -o pid= -oargs=&lt;BR /&gt;&lt;BR /&gt;-------------------------------------------&lt;BR /&gt;&lt;BR /&gt;Bill, I've never used the UNIX95 command.  I noticed the flags you used for the pid and other arguments.  Is the "-o pid=" required?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Jul 2010 18:27:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-remote-variables-more-efficiently/m-p/4660178#M677492</guid>
      <dc:creator>Patrick Ware_1</dc:creator>
      <dc:date>2010-07-16T18:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Getting remote variables more efficiently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-remote-variables-more-efficiently/m-p/4660179#M677493</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;Bill's UNIX95 argument is required for values on his recommended ps command.&lt;BR /&gt;&lt;BR /&gt;Without setting the variable, you won't get the data.&lt;BR /&gt;&lt;BR /&gt;First time I saw this, I got all excited and set UNIX95 in my /etc/profile . That was a bad idea, as it broke several things on the system.&lt;BR /&gt;&lt;BR /&gt;You need UNIX95 for the command Bill recommends.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Fri, 16 Jul 2010 18:44:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-remote-variables-more-efficiently/m-p/4660179#M677493</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2010-07-16T18:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Getting remote variables more efficiently</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/getting-remote-variables-more-efficiently/m-p/4660180#M677494</link>
      <description>&amp;gt; Bill, I've never used the UNIX95 command.  I noticed the flags you used for the pid and other arguments.  Is the "-o pid=" required?&lt;BR /&gt; &lt;BR /&gt;UNIX95 is a variable, not a command. It is an underutilized feature of the shell that you can temporarily assign a variable for the duration of the command by making the assignment in front of a command. UNIX95 (when defined) enables 3 VERY useful options:&lt;BR /&gt; &lt;BR /&gt;-C exact-process-name&lt;BR /&gt;-H show hierarchy of parents and children&lt;BR /&gt;-o make your own customized ps command&lt;BR /&gt; &lt;BR /&gt;-C is the only way to stop grep failures -- let ps find the process in the kernel's process table. So ps -C sh and ps -C ksh will get exact matches.&lt;BR /&gt; &lt;BR /&gt;-o &lt;KEYWORD&gt; allows you to choose the columns you want in the output. The optional = sign says use this label instead of the default, and with nothing following the two option= arguments, ps removes the title line completely, perfect for scripting.&lt;/KEYWORD&gt;</description>
      <pubDate>Fri, 16 Jul 2010 18:55:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/getting-remote-variables-more-efficiently/m-p/4660180#M677494</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2010-07-16T18:55:31Z</dc:date>
    </item>
  </channel>
</rss>

