<?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 trap question in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462272#M210313</link>
    <description>I want to know what is the (trap).&lt;BR /&gt;&lt;BR /&gt;i read about it .but i coudn't use it &lt;BR /&gt;can any one help me?&lt;BR /&gt;&lt;BR /&gt;i want an example</description>
    <pubDate>Thu, 13 Jan 2005 04:30:58 GMT</pubDate>
    <dc:creator>kamal_15</dc:creator>
    <dc:date>2005-01-13T04:30:58Z</dc:date>
    <item>
      <title>trap question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462272#M210313</link>
      <description>I want to know what is the (trap).&lt;BR /&gt;&lt;BR /&gt;i read about it .but i coudn't use it &lt;BR /&gt;can any one help me?&lt;BR /&gt;&lt;BR /&gt;i want an example</description>
      <pubDate>Thu, 13 Jan 2005 04:30:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462272#M210313</guid>
      <dc:creator>kamal_15</dc:creator>
      <dc:date>2005-01-13T04:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: trap question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462273#M210314</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;trap is a shell command to ignore certain signals like ^C or hangup. See the manual page of the shell you are using. It is used like&lt;BR /&gt;trap 1 2 15 ""&lt;BR /&gt;You specify the signals you want to catch and the action that is to be taken when a signal occurs.&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jan 2005 04:35:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462273#M210314</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2005-01-13T04:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: trap question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462274#M210315</link>
      <description>thank u man &lt;BR /&gt;&lt;BR /&gt;but i don't understand how can i receive the&lt;BR /&gt;output from trap?&lt;BR /&gt;&lt;BR /&gt;EX:&lt;BR /&gt;****&lt;BR /&gt;if i want to execute a sample shell&lt;BR /&gt;and i want to receive a signals explane the status.&lt;BR /&gt;&lt;BR /&gt;what command can i write to do that&lt;BR /&gt;&lt;BR /&gt;NOTE:&lt;BR /&gt;i have hp-ux V.10&lt;BR /&gt;when i type&lt;BR /&gt;man trap&lt;BR /&gt;no manual entry&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;thanx&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jan 2005 04:48:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462274#M210315</guid>
      <dc:creator>kamal_15</dc:creator>
      <dc:date>2005-01-13T04:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: trap question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462275#M210316</link>
      <description>man trap wont show anything because trap is part of the shell. Try man ksh instead and look for trap&lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt;&lt;BR /&gt;trap 15 "echo \"Hello\""&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jan 2005 04:50:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462275#M210316</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-01-13T04:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: trap question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462276#M210317</link>
      <description>If you do&lt;BR /&gt;# kill -l&lt;BR /&gt;it will show you the names of the signals and their numeric values. e.g.&lt;BR /&gt;&lt;BR /&gt;15 = TERM or SIGTERM&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Jan 2005 04:53:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462276#M210317</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-01-13T04:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: trap question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462277#M210318</link>
      <description>Trap is an interrupt signal (CTRL-C) usually kills the process.&lt;BR /&gt;&lt;BR /&gt;Processes may be sent signals using either the kill command, or a control key combination such as CTRL-C. &lt;BR /&gt;&lt;BR /&gt;The trap command typically appears as one of the first lines in the shell script. It contains the commands to be executed when a signal is detected as well as what signals to trap. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;TMPFILE=/usr/tmp/junk.$$&lt;BR /&gt;trap 'rm -f $TMPFILE; exit 0' 1 2 15 &lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;Upon receiving signals 1, 2 or 15, $TMPFILE would be deleted and the script would terminate the shell script normally. This shows how trap may be used to clean up before exiting. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh&lt;BR /&gt;TMPFILE=/usr/tmp/junk.$$&lt;BR /&gt;trap '' 0 1 2&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;.&lt;BR /&gt;&lt;BR /&gt;The above example shows how trap may be used to ignore specific signals (0, 1 and 2). &lt;BR /&gt;&lt;BR /&gt;NOTE that when the signal is received, the command currently being executed is interrupted, and execution flow continues at the next line of the script. &lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;BR /&gt;&lt;BR /&gt;--&lt;BR /&gt;M</description>
      <pubDate>Thu, 13 Jan 2005 06:36:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462277#M210318</guid>
      <dc:creator>Michael Selvesteen_2</dc:creator>
      <dc:date>2005-01-13T06:36:09Z</dc:date>
    </item>
    <item>
      <title>Re: trap question</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462278#M210319</link>
      <description>Hi Kamal&lt;BR /&gt;&lt;BR /&gt;For future reference.&lt;BR /&gt;&lt;BR /&gt;The command "man sh-posix" would be a good place to look for infomation regarding built in shell commands.&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;Gerhard</description>
      <pubDate>Fri, 14 Jan 2005 03:21:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trap-question/m-p/3462278#M210319</guid>
      <dc:creator>Gerhard Roets</dc:creator>
      <dc:date>2005-01-14T03:21:30Z</dc:date>
    </item>
  </channel>
</rss>

