<?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: Korn scripting question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887810#M281017</link>
    <description>If I remember correctly, if you only require the PIDs of "active" files then you need to redirect stderr of the HP-UX incarnation of the fuser command to /dev/null.&lt;BR /&gt;Try appending 2&amp;gt;/dev/null before piping into grep or awk.&lt;BR /&gt;I'm not quite sure if I got what your intentions are?&lt;BR /&gt;</description>
    <pubDate>Fri, 27 Oct 2006 06:13:55 GMT</pubDate>
    <dc:creator>Ralph Grothe</dc:creator>
    <dc:date>2006-10-27T06:13:55Z</dc:date>
    <item>
      <title>Korn scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887808#M281015</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I'm trying to run the following .... &lt;BR /&gt;&lt;BR /&gt;$ script test.scr&lt;BR /&gt;$ ls -1 *.txt&lt;BR /&gt;$ exit&lt;BR /&gt;$ cat test.scr&lt;BR /&gt;&lt;BR /&gt;... but inside a korn script. So something like :&lt;BR /&gt;&lt;BR /&gt;#/usr/bin/ksh&lt;BR /&gt;script test.scr &amp;lt;&amp;lt; EOF&lt;BR /&gt;ls -1 *.txt&lt;BR /&gt;exit&lt;BR /&gt;EOF&lt;BR /&gt;cat test.scr&lt;BR /&gt;&lt;BR /&gt;This obviously will not work, but does anyone know how I can pass an exit statement to the script process in order for it to terminate?&lt;BR /&gt;The script is more complicated than the above (in case someone asks why I'm using the 'script' binary), but I cannot redirect the following to a file :&lt;BR /&gt;&lt;BR /&gt;find /app/oracle/admin/udlgrid1/udump -name "*.trc" -mtime 2 -exec /usr/sbin/fuser {} \; | grep : | awk -F":" '{print $2;next}'&lt;BR /&gt;&lt;BR /&gt;my attempt using :&lt;BR /&gt;find /app/oracle/admin/udlgrid1/udump -name "*.trc" -mtime 2 -exec /usr/sbin/fuser {} \; | grep : | awk -F":" '{print $2;next}' &amp;gt; tracefiles.txt&lt;BR /&gt;&lt;BR /&gt;does not seem to work&lt;BR /&gt;&lt;BR /&gt;any other options appreciated&lt;BR /&gt;&lt;BR /&gt;thanks in advance&lt;BR /&gt;John&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Oct 2006 03:09:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887808#M281015</guid>
      <dc:creator>u856100</dc:creator>
      <dc:date>2006-10-27T03:09:08Z</dc:date>
    </item>
    <item>
      <title>Re: Korn scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887809#M281016</link>
      <description>Shalom John,&lt;BR /&gt;&lt;BR /&gt;I would suggest building a two script system with an exit at the end of the second script.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Fri, 27 Oct 2006 04:58:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887809#M281016</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2006-10-27T04:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Korn scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887810#M281017</link>
      <description>If I remember correctly, if you only require the PIDs of "active" files then you need to redirect stderr of the HP-UX incarnation of the fuser command to /dev/null.&lt;BR /&gt;Try appending 2&amp;gt;/dev/null before piping into grep or awk.&lt;BR /&gt;I'm not quite sure if I got what your intentions are?&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Oct 2006 06:13:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887810#M281017</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2006-10-27T06:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Korn scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887811#M281018</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;I'm also not sure of your intentions.  Oracle trace files are generated when a background process or user process encounters an exception.  I don't see why any process would have a trace file open after it has been written to initially.&lt;BR /&gt;&lt;BR /&gt;In any event, you may want to give 'lsof' a shot, although I personally find it very flaky under HP-UX.&lt;BR /&gt;&lt;BR /&gt;By the way, the format of a background trace filename is:&lt;BR /&gt;&lt;BR /&gt;sid_proc_ospid.trc&lt;BR /&gt;&lt;BR /&gt;where&lt;BR /&gt;sid = Oracle instance name&lt;BR /&gt;proc = Oracle bg thread name&lt;BR /&gt;ospid = HP-UX pid&lt;BR /&gt;&lt;BR /&gt;As you can see, the pid of the offending process is embedded in the filename.  This is also true for user thread trace files, although the naming format is a bit different.&lt;BR /&gt;&lt;BR /&gt;PCS</description>
      <pubDate>Fri, 27 Oct 2006 07:19:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887811#M281018</guid>
      <dc:creator>spex</dc:creator>
      <dc:date>2006-10-27T07:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Korn scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887812#M281019</link>
      <description>thanks people, appreciate the responses. We have some problems with oracle not releasing file handles on trace files (very strange). As a result our housekeeping scripts are creating a load of zombie processes that are still claiming space.&lt;BR /&gt;&lt;BR /&gt;I'll go with the two script option&lt;BR /&gt;&lt;BR /&gt;many thanks again</description>
      <pubDate>Fri, 27 Oct 2006 07:29:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887812#M281019</guid>
      <dc:creator>u856100</dc:creator>
      <dc:date>2006-10-27T07:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Korn scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887813#M281020</link>
      <description>Hi Joh,&lt;BR /&gt;&lt;BR /&gt;Use the "exec" command rather "script"&lt;BR /&gt;&lt;BR /&gt;Sample:&lt;BR /&gt;&lt;BR /&gt;# begin script&lt;BR /&gt;exec &amp;gt; /tmp/sample.txt&lt;BR /&gt;find /app/oracle/admin/....&lt;BR /&gt;...&lt;BR /&gt;# end escript&lt;BR /&gt;&lt;BR /&gt;rgs,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 27 Oct 2006 07:41:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887813#M281020</guid>
      <dc:creator>rariasn</dc:creator>
      <dc:date>2006-10-27T07:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Korn scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887814#M281021</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if you want to have the stderr as well in the file - what I assume - modify the solution of rgs to:&lt;BR /&gt;&lt;BR /&gt;exec &amp;gt;/tmp/listing 2&amp;gt;&amp;amp;1&lt;BR /&gt;commands...&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;mfG Peter</description>
      <pubDate>Fri, 27 Oct 2006 10:20:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887814#M281021</guid>
      <dc:creator>Peter Nikitka</dc:creator>
      <dc:date>2006-10-27T10:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Korn scripting question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887815#M281022</link>
      <description>Hi,&lt;BR /&gt;you could use the '{}' way:&lt;BR /&gt;&lt;BR /&gt;#/usr/bin/ksh&lt;BR /&gt;{&lt;BR /&gt;ls -1 *.txt&lt;BR /&gt;exit&lt;BR /&gt;} &amp;gt;test.src&lt;BR /&gt;cat test.scr&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Art</description>
      <pubDate>Mon, 30 Oct 2006 02:52:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-scripting-question/m-p/3887815#M281022</guid>
      <dc:creator>Arturo Galbiati</dc:creator>
      <dc:date>2006-10-30T02:52:47Z</dc:date>
    </item>
  </channel>
</rss>

