<?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: ksh scripting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149278#M157271</link>
    <description>Is it realy that simpel . . .  :`-(&lt;BR /&gt;Well it's friday my mind seems to be on leaf allready.&lt;BR /&gt;&lt;BR /&gt;Kl@@S</description>
    <pubDate>Fri, 19 Dec 2003 07:21:04 GMT</pubDate>
    <dc:creator>Klaas D. Eenkhoorn</dc:creator>
    <dc:date>2003-12-19T07:21:04Z</dc:date>
    <item>
      <title>ksh scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149274#M157267</link>
      <description>Dear all,&lt;BR /&gt;&lt;BR /&gt;I have a question wich breakes my mind.&lt;BR /&gt;&lt;BR /&gt;I have a script monitoring a log file for specific messages.&lt;BR /&gt;I use the construction:&lt;BR /&gt;&lt;BR /&gt;tail -f $logfile | while read line&lt;BR /&gt;do&lt;BR /&gt;case $line in&lt;BR /&gt;ORA-*)&lt;BR /&gt;echo "Fout in logfile: $line&lt;BR /&gt;;;&lt;BR /&gt;esac&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;This script, written in KSH will run until the system is stopped or until i kill the script.&lt;BR /&gt;If i do this with kill -15 PID (of the script)&lt;BR /&gt;Tail stays behind in the process table with a parent process of 1&lt;BR /&gt;&lt;BR /&gt;How do i stop this process together with my script ?&lt;BR /&gt;&lt;BR /&gt;Kl@@s&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Dec 2003 07:07:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149274#M157267</guid>
      <dc:creator>Klaas D. Eenkhoorn</dc:creator>
      <dc:date>2003-12-19T07:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: ksh scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149275#M157268</link>
      <description>Kill the PID of the "tail" instead.  This will also cause the script to finish.</description>
      <pubDate>Fri, 19 Dec 2003 07:17:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149275#M157268</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2003-12-19T07:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: ksh scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149276#M157269</link>
      <description>From the man page on the -f option:&lt;BR /&gt;&lt;BR /&gt; (tail enters&lt;BR /&gt;                          an endless loop wherein it sleeps for one second&lt;BR /&gt;                          then attempts to read and copy further records&lt;BR /&gt;                          from the input file)&lt;BR /&gt;&lt;BR /&gt;So thats why there is a problem.  I'm not sure of a solution yet :-) I'll continue looking.</description>
      <pubDate>Fri, 19 Dec 2003 07:18:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149276#M157269</guid>
      <dc:creator>Kent Ostby</dc:creator>
      <dc:date>2003-12-19T07:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: ksh scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149277#M157270</link>
      <description>The parent PID of tail is your script.&lt;BR /&gt;you shouild be able to find both PID and kill them all in one go&lt;BR /&gt;kill -15 PID1 PID2&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Fri, 19 Dec 2003 07:19:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149277#M157270</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2003-12-19T07:19:54Z</dc:date>
    </item>
    <item>
      <title>Re: ksh scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149278#M157271</link>
      <description>Is it realy that simpel . . .  :`-(&lt;BR /&gt;Well it's friday my mind seems to be on leaf allready.&lt;BR /&gt;&lt;BR /&gt;Kl@@S</description>
      <pubDate>Fri, 19 Dec 2003 07:21:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149278#M157271</guid>
      <dc:creator>Klaas D. Eenkhoorn</dc:creator>
      <dc:date>2003-12-19T07:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: ksh scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149279#M157272</link>
      <description>Have you tried kill -9?&lt;BR /&gt;&lt;BR /&gt;Mark Syder (like the drink but spelt different)</description>
      <pubDate>Fri, 19 Dec 2003 07:21:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149279#M157272</guid>
      <dc:creator>MarkSyder</dc:creator>
      <dc:date>2003-12-19T07:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: ksh scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149280#M157273</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;the script is run by who? By an interactive shell, with nohup or what? When you run it with nohup, you will have to kill the tail. Of course you can allways kill the shell too.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Dec 2003 12:12:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149280#M157273</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2003-12-19T12:12:49Z</dc:date>
    </item>
    <item>
      <title>Re: ksh scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149281#M157274</link>
      <description>Mark&lt;BR /&gt;&lt;BR /&gt;-9 ??&lt;BR /&gt;&lt;BR /&gt;Sledgehammer to catch a butterfly,&lt;BR /&gt;Use kill -9 as the very very last resort.&lt;BR /&gt;&lt;BR /&gt;Paula&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Dec 2003 12:27:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149281#M157274</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2003-12-19T12:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: ksh scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149282#M157275</link>
      <description>Klaas,&lt;BR /&gt;&lt;BR /&gt;As the other Mark G wrote, kill the "tail" process. It should go away with just a "kill". If you have to use a -9, you have other problems; however, your script is hardly that complex so you ought not have to resort to the -9.&lt;BR /&gt;&lt;BR /&gt;mark</description>
      <pubDate>Fri, 19 Dec 2003 13:40:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149282#M157275</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2003-12-19T13:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: ksh scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149283#M157276</link>
      <description>A little know fact about the "kill" command is that if you put a "-" in front of the pid, it will kill all processes that in that "process group".&lt;BR /&gt; &lt;BR /&gt;$ ps -ef | grep tail&lt;BR /&gt;  rhills  6725  6723  0 11:58:12 pts/tTb   0:00 tail -f /var/adm/syslog/syslog.log&lt;BR /&gt;  rhills  6730  5560  2 11:58:18 pts/tt    0:00 grep tail&lt;BR /&gt;pegasus rhills $ kill -15 -6723&lt;BR /&gt;pegasus rhills $ ps -ef | grep tail&lt;BR /&gt;  rhills  6744  5560  0 11:58:32 pts/tt    0:00 grep tail&lt;BR /&gt; &lt;BR /&gt;I killed the pid 6723 (ksh parent of tail child) and it not only killed the ksh script, but also the tail.&lt;BR /&gt; &lt;BR /&gt;Another alternative is to put a "trap" in your script, that when the ksh script is killed, it then kills the tail command.&lt;BR /&gt; &lt;BR /&gt;HTH&lt;BR /&gt; &lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Fri, 19 Dec 2003 15:02:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149283#M157276</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-12-19T15:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: ksh scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149284#M157277</link>
      <description>kill -15 -PID&lt;BR /&gt;&lt;BR /&gt;with -PID you send the signal to all the proces s group.&lt;BR /&gt;&lt;BR /&gt;this ksh is not interactif so the other are run in its process group.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Dec 2003 18:17:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149284#M157277</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2003-12-19T18:17:32Z</dc:date>
    </item>
    <item>
      <title>Re: ksh scripting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149285#M157278</link>
      <description>I use this:&lt;BR /&gt;&lt;BR /&gt;export JOBNUM=$$&lt;BR /&gt;&lt;BR /&gt;$$ is the PID of the current script.  You can store that and kill it later when ever you're ready.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;-Brian.</description>
      <pubDate>Fri, 19 Dec 2003 19:03:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ksh-scripting/m-p/3149285#M157278</guid>
      <dc:creator>Brian Markus</dc:creator>
      <dc:date>2003-12-19T19:03:33Z</dc:date>
    </item>
  </channel>
</rss>

