<?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: ps -o within script fails in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147173#M899586</link>
    <description>I don't think you want to export UNIX95.  This mean the variable will be set for all commands.&lt;BR /&gt; &lt;BR /&gt;See if this makes any difference&lt;BR /&gt; &lt;BR /&gt;UNIX95= $PS ${PS_OPT}</description>
    <pubDate>Wed, 17 Dec 2003 10:24:03 GMT</pubDate>
    <dc:creator>Mark Grant</dc:creator>
    <dc:date>2003-12-17T10:24:03Z</dc:date>
    <item>
      <title>ps -o within script fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147172#M899585</link>
      <description>Hi.&lt;BR /&gt;&lt;BR /&gt;I want to use the ps command within a script to control processes and I want to build it with variables:&lt;BR /&gt;PS="/usr/bin/ps"&lt;BR /&gt;PS_OPT="-efl"&lt;BR /&gt;$PS ${PS_OPT} &amp;gt; temp_file&lt;BR /&gt;&lt;BR /&gt;It works fine when PS_OPT="-efl" but it does not work when PS_OPT="-e -o args"; I get the following error message:&lt;BR /&gt;/usr/bin/ps: illegal option --  &lt;BR /&gt;/usr/bin/ps: illegal option -- -&lt;BR /&gt;/usr/bin/ps:  is not a valid field name&lt;BR /&gt;&lt;BR /&gt;To be able using the -o option I set UNXI95 to 1 and export it just before executing the ps command.&lt;BR /&gt;&lt;BR /&gt;ps -e -o args works fine when executed directly on command line.</description>
      <pubDate>Wed, 17 Dec 2003 10:18:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147172#M899585</guid>
      <dc:creator>Sylvain CROUET</dc:creator>
      <dc:date>2003-12-17T10:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: ps -o within script fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147173#M899586</link>
      <description>I don't think you want to export UNIX95.  This mean the variable will be set for all commands.&lt;BR /&gt; &lt;BR /&gt;See if this makes any difference&lt;BR /&gt; &lt;BR /&gt;UNIX95= $PS ${PS_OPT}</description>
      <pubDate>Wed, 17 Dec 2003 10:24:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147173#M899586</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-12-17T10:24:03Z</dc:date>
    </item>
    <item>
      <title>Re: ps -o within script fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147174#M899587</link>
      <description>The -o switch is part of the XPG4 extensions to ps, invoked with the "UNIX95= ps -o" syntax.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Pete</description>
      <pubDate>Wed, 17 Dec 2003 10:25:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147174#M899587</guid>
      <dc:creator>Pete Randall</dc:creator>
      <dc:date>2003-12-17T10:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: ps -o within script fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147175#M899588</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I confirm that this 3 lines script works perfectly :&lt;BR /&gt;&lt;BR /&gt;PS="/usr/bin/ps"&lt;BR /&gt;PS_OPT="-e -o args"&lt;BR /&gt;UNIX95= $PS ${PS_OPT}&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Wed, 17 Dec 2003 10:26:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147175#M899588</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-12-17T10:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: ps -o within script fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147176#M899589</link>
      <description>This should work for you:&lt;BR /&gt;&lt;BR /&gt;PS="/usr/bin/ps"&lt;BR /&gt;PS_OPT="-e -o args"&lt;BR /&gt;UNIX95= $PS $PS_OPT&lt;BR /&gt;&lt;BR /&gt;Use UNIX95 with the command instead of exporting it.</description>
      <pubDate>Wed, 17 Dec 2003 10:29:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147176#M899589</guid>
      <dc:creator>Helen French</dc:creator>
      <dc:date>2003-12-17T10:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: ps -o within script fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147177#M899590</link>
      <description>As everyone has stated, DON'T export UNIX95. It will affect other commands and libraries, sometimes producing undesired effects. UNIX95 is defined in certain commands but there is no central list so you'd have to read every man page for every command and function. To get a sense of the pervasiveness of this command, go to docs.hp.com and search for UNIX95.&lt;BR /&gt; &lt;BR /&gt;As mentioned, always put UNIX95= in front of the ps command. NOTE: It may look strange but it wor4ks just fine. You don't have to assign a value, just the = sign is fine.</description>
      <pubDate>Wed, 17 Dec 2003 10:52:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147177#M899590</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-12-17T10:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: ps -o within script fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147178#M899591</link>
      <description>It still does not work.&lt;BR /&gt;Here is my script attached. Have I made some mistakes I am unable to see?</description>
      <pubDate>Wed, 17 Dec 2003 11:24:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147178#M899591</guid>
      <dc:creator>Sylvain CROUET</dc:creator>
      <dc:date>2003-12-17T11:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: ps -o within script fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147179#M899592</link>
      <description>Looks OK. I pasted the 3 lines for PS and PS_OPT then the commandline and it works OK. Run your script with tracing:&lt;BR /&gt; &lt;BR /&gt;sh -x &lt;YOUR_SCRIPT&gt;&lt;/YOUR_SCRIPT&gt;</description>
      <pubDate>Wed, 17 Dec 2003 11:31:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147179#M899592</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-12-17T11:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: ps -o within script fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147180#M899593</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try to avoid the IFS="|". Use it only at the place where you need it and restore the default value after, ie :&lt;BR /&gt;&lt;BR /&gt;OFS="$IFS"&lt;BR /&gt;IFS="|"&lt;BR /&gt;xxxx&lt;BR /&gt;IFS=$"OFS"&lt;BR /&gt;&lt;BR /&gt;without IFS changed, your script works ...&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Wed, 17 Dec 2003 11:36:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147180#M899593</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-12-17T11:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: ps -o within script fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147181#M899594</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;in your case, to avoid modifying IFS you could also use :&lt;BR /&gt;&lt;BR /&gt;cat $FICHIER_PARAM | tr -d '|' ' ' | while read ...&lt;BR /&gt;do&lt;BR /&gt;  xxx&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards.</description>
      <pubDate>Wed, 17 Dec 2003 11:39:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147181#M899594</guid>
      <dc:creator>Jean-Louis Phelix</dc:creator>
      <dc:date>2003-12-17T11:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: ps -o within script fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147182#M899595</link>
      <description>Exact, the problem was due to the IFS.&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 18 Dec 2003 07:10:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ps-o-within-script-fails/m-p/3147182#M899595</guid>
      <dc:creator>Sylvain CROUET</dc:creator>
      <dc:date>2003-12-18T07:10:53Z</dc:date>
    </item>
  </channel>
</rss>

