<?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 quries in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571802#M702689</link>
    <description>How are you running the script?&lt;BR /&gt;&lt;BR /&gt;Are you running it like:&lt;BR /&gt;&lt;BR /&gt;$ ksh ./scriptname&lt;BR /&gt;&lt;BR /&gt;or do you have #!/usr/bin/ksh as the first line of the script?</description>
    <pubDate>Mon, 27 Jun 2005 22:56:00 GMT</pubDate>
    <dc:creator>Patrick Wallek</dc:creator>
    <dc:date>2005-06-27T22:56:00Z</dc:date>
    <item>
      <title>script quries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571800#M702687</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;When I run a script, I got the following using ps -ef | grep &amp;lt;script&amp;gt;:&lt;BR /&gt;&lt;BR /&gt;cis_opr 11610     1  0 08:35:30 ?        0:00 /bin/ksh ./&amp;lt;script&amp;gt;&lt;BR /&gt;&lt;BR /&gt;Can the script be run so that ps -ef | grep &amp;lt;script&amp;gt; will get the following (ie without /bin/ksh&amp;gt;&lt;BR /&gt;&lt;BR /&gt;cis_opr 11610     1  0 08:35:30 ?        0:00 ./ezproxy&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Mon, 27 Jun 2005 20:47:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571800#M702687</guid>
      <dc:creator>yc_2</dc:creator>
      <dc:date>2005-06-27T20:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: script quries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571801#M702688</link>
      <description>you have to use awk to parse the output, &lt;BR /&gt;for example, &lt;BR /&gt;&lt;BR /&gt;ps -ef | grep &amp;lt;script&amp;gt;|awk '{print $1,$2,$3,$4,$5,$6,$7,$9}'</description>
      <pubDate>Mon, 27 Jun 2005 21:18:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571801#M702688</guid>
      <dc:creator>Matthew_50</dc:creator>
      <dc:date>2005-06-27T21:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: script quries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571802#M702689</link>
      <description>How are you running the script?&lt;BR /&gt;&lt;BR /&gt;Are you running it like:&lt;BR /&gt;&lt;BR /&gt;$ ksh ./scriptname&lt;BR /&gt;&lt;BR /&gt;or do you have #!/usr/bin/ksh as the first line of the script?</description>
      <pubDate>Mon, 27 Jun 2005 22:56:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571802#M702689</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2005-06-27T22:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: script quries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571803#M702690</link>
      <description>Hi Patrick Wallek,&lt;BR /&gt;&lt;BR /&gt;When the script was executed, it consists of the following:&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;I cotook out the #!/usr/bin/ksh and ran:&lt;BR /&gt;&lt;BR /&gt;#ksh ./&amp;lt;script&amp;gt;&lt;BR /&gt;&lt;BR /&gt;The result of ps -ef | grep &amp;lt;script&amp;gt; is the same.</description>
      <pubDate>Tue, 28 Jun 2005 00:52:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571803#M702690</guid>
      <dc:creator>yc_2</dc:creator>
      <dc:date>2005-06-28T00:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: script quries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571804#M702691</link>
      <description>If you are running ksh script, that suggests the script is not an executable.&lt;BR /&gt;&lt;BR /&gt;Try:&lt;BR /&gt;&lt;BR /&gt;chmod +x script (or chmod 744 if you only want the owner to be able to execute the script)&lt;BR /&gt;./script&lt;BR /&gt;&lt;BR /&gt;Mark Syder (like the drink but spelt different)</description>
      <pubDate>Tue, 28 Jun 2005 02:48:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571804#M702691</guid>
      <dc:creator>MarkSyder</dc:creator>
      <dc:date>2005-06-28T02:48:02Z</dc:date>
    </item>
    <item>
      <title>Re: script quries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571805#M702692</link>
      <description>I think the problem is that the script that you are running has some syntaxes specific to ksh.&lt;BR /&gt;&lt;BR /&gt;That's why you have to use either of the 2 things: ksh or #/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;and this may be the reason why its showing in ps -ef.&lt;BR /&gt;&lt;BR /&gt;Check what is your default shell, try changing it and then running.</description>
      <pubDate>Tue, 28 Jun 2005 03:32:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571805#M702692</guid>
      <dc:creator>Vibhor Kumar Agarwal</dc:creator>
      <dc:date>2005-06-28T03:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: script quries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571806#M702693</link>
      <description>I'm afraid, I think you will have to parse the output from ps yourself.&lt;BR /&gt;It's true that if you run a script in the process table as cmd appears the interpreter (i.e. in your case /bin/ksh).&lt;BR /&gt;Because I haven't your process running I used a running Perl script of mine as an example for how such parsing could look like.&lt;BR /&gt;As you may recognise I stripped off the 2nd field from the right side which holds the interpreter.&lt;BR /&gt;I used Perl for parsing but you could as well use any combination of awk, grep, sed, cut, tr ...&lt;BR /&gt; &lt;BR /&gt;$ UNIX95= ps -fC arschd|perl -anle 'if($.&amp;gt;1){$F[-2]=undef;print "@F" }'&lt;BR /&gt;saz 4288 1 0 Jun 26 ? 00:01  /usr/local/sbin/arschd&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt;I have to admid, because with ps output you have varying fields, that it would be better to use Perl's pack() function for this purpose.&lt;BR /&gt;But I thought this would be too distracting.</description>
      <pubDate>Tue, 28 Jun 2005 04:01:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571806#M702693</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2005-06-28T04:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: script quries</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571807#M702694</link>
      <description>An expansion on Mark Syder's answer.&lt;BR /&gt;&lt;BR /&gt;Yes, make the script file it's self executable (chmod), but also make sure that the first line of the script is something similar to:&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;This will tell the OS that when you run the script directly (i.e. ./ezproxy), it will use the interpreter '/bin/ksh' to run it in.&lt;BR /&gt;&lt;BR /&gt;Go #! magic ;)</description>
      <pubDate>Tue, 28 Jun 2005 08:52:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-quries/m-p/3571807#M702694</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2005-06-28T08:52:05Z</dc:date>
    </item>
  </channel>
</rss>

