<?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: trapping control C in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/trapping-control-c/m-p/2533415#M728732</link>
    <description>Instead to write a funtion in trap stament ( rm xxx; echo ....; exit ...) you can write a function and call it inside trap.&lt;BR /&gt;&lt;BR /&gt;Also, read sh ( man ksh, sh_posix ..)  for exceptions.</description>
    <pubDate>Mon, 28 May 2001 12:37:56 GMT</pubDate>
    <dc:creator>Carlos Fernandez Riera</dc:creator>
    <dc:date>2001-05-28T12:37:56Z</dc:date>
    <item>
      <title>trapping control C</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trapping-control-c/m-p/2533412#M728729</link>
      <description>Hi&lt;BR /&gt;   Can we trap control C in a shell script and exit gracefully ???</description>
      <pubDate>Mon, 28 May 2001 10:34:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trapping-control-c/m-p/2533412#M728729</guid>
      <dc:creator>Praveen Bezawada</dc:creator>
      <dc:date>2001-05-28T10:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: trapping control C</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trapping-control-c/m-p/2533413#M728730</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Yes, try this:&lt;BR /&gt;&lt;BR /&gt;trap "echo intr detected; exit 2" 2&lt;BR /&gt;&lt;BR /&gt;echo "Begin"&lt;BR /&gt;echo "Enter Value 1: \c"&lt;BR /&gt;read V1&lt;BR /&gt;echo "Enter Value 2: \c"&lt;BR /&gt;read V2&lt;BR /&gt;echo "End"&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;I assume that you have set intterupt to cntl-c.&lt;BR /&gt;If at any time, you press ctrl-c the trap is executed - unless the parent process is set to ignore interrupts. &lt;BR /&gt;&lt;BR /&gt;If for example you might create temp files in your script, you should also add rm -f $tfile1 $tfile2 (e.g.) to your trap statement.&lt;BR /&gt;&lt;BR /&gt;This should get you started, Clay</description>
      <pubDate>Mon, 28 May 2001 10:48:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trapping-control-c/m-p/2533413#M728730</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2001-05-28T10:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: trapping control C</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trapping-control-c/m-p/2533414#M728731</link>
      <description>&lt;BR /&gt;i'd do like this:&lt;BR /&gt;&lt;BR /&gt;trap "echo ^C captured ; exit " 2 &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 28 May 2001 11:48:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trapping-control-c/m-p/2533414#M728731</guid>
      <dc:creator>federico_3</dc:creator>
      <dc:date>2001-05-28T11:48:42Z</dc:date>
    </item>
    <item>
      <title>Re: trapping control C</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/trapping-control-c/m-p/2533415#M728732</link>
      <description>Instead to write a funtion in trap stament ( rm xxx; echo ....; exit ...) you can write a function and call it inside trap.&lt;BR /&gt;&lt;BR /&gt;Also, read sh ( man ksh, sh_posix ..)  for exceptions.</description>
      <pubDate>Mon, 28 May 2001 12:37:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/trapping-control-c/m-p/2533415#M728732</guid>
      <dc:creator>Carlos Fernandez Riera</dc:creator>
      <dc:date>2001-05-28T12:37:56Z</dc:date>
    </item>
  </channel>
</rss>

