<?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 How do I ignore Ctrl-C in ksh scripts? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193174#M714097</link>
    <description>I showed the DBAs how to run our basic BCV unmount/synch/split/mount scripts.&lt;BR /&gt;&lt;BR /&gt;Today, not for the first time, one of the DBAs "Ctrl-C"-d out of one of the BCV scripts, thus leaving the BCV in an "inconsistent" state - half-way unmounted and halfway still mounted (if you follow my meaning).&lt;BR /&gt;&lt;BR /&gt;How so I modify a ksh script to IGNORE Ctrl-C?  I don't want to "trap" it.  I just want to ignore it, and keep right on going from where it is.</description>
    <pubDate>Mon, 16 Feb 2004 11:32:00 GMT</pubDate>
    <dc:creator>Stuart Abramson_2</dc:creator>
    <dc:date>2004-02-16T11:32:00Z</dc:date>
    <item>
      <title>How do I ignore Ctrl-C in ksh scripts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193174#M714097</link>
      <description>I showed the DBAs how to run our basic BCV unmount/synch/split/mount scripts.&lt;BR /&gt;&lt;BR /&gt;Today, not for the first time, one of the DBAs "Ctrl-C"-d out of one of the BCV scripts, thus leaving the BCV in an "inconsistent" state - half-way unmounted and halfway still mounted (if you follow my meaning).&lt;BR /&gt;&lt;BR /&gt;How so I modify a ksh script to IGNORE Ctrl-C?  I don't want to "trap" it.  I just want to ignore it, and keep right on going from where it is.</description>
      <pubDate>Mon, 16 Feb 2004 11:32:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193174#M714097</guid>
      <dc:creator>Stuart Abramson_2</dc:creator>
      <dc:date>2004-02-16T11:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I ignore Ctrl-C in ksh scripts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193175#M714098</link>
      <description>I assume that Ctrl-C triggers a SIGINT. Confirm this via stty -a and look for the value associated with "intr".&lt;BR /&gt;&lt;BR /&gt;You can now cause a SININT to be ignored via the trap statement using a null string command argument.&lt;BR /&gt;&lt;BR /&gt;trap '' 2&lt;BR /&gt;&lt;BR /&gt;Plan B. Use stty to set intr to an impossible value:&lt;BR /&gt;stty intr 0377&lt;BR /&gt;but be sure to reset to original value later because a stty command applies to the terminal device rather than a process.&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Feb 2004 11:41:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193175#M714098</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-02-16T11:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: How do I ignore Ctrl-C in ksh scripts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193176#M714099</link>
      <description>Clay:&lt;BR /&gt;&lt;BR /&gt;That looks absolutely right to me.  I'll give it a try and post points.&lt;BR /&gt;&lt;BR /&gt;  Stuart</description>
      <pubDate>Mon, 16 Feb 2004 13:43:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193176#M714099</guid>
      <dc:creator>Stuart Abramson_2</dc:creator>
      <dc:date>2004-02-16T13:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I ignore Ctrl-C in ksh scripts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193177#M714100</link>
      <description>You probably want to trap all the common interrupts and ignore them. The HP-UX standard /etc/profile does this. Do it this way:&lt;BR /&gt; &lt;BR /&gt;trap "" 1 2 3&lt;BR /&gt; &lt;BR /&gt;or&lt;BR /&gt; &lt;BR /&gt;trap "" HUP INT QUIT&lt;BR /&gt; &lt;BR /&gt;This will do nothing for CTRL-C, as well as a hang-up (connection break, either modem or network) or kill -3 to create a core dump.</description>
      <pubDate>Mon, 16 Feb 2004 14:00:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193177#M714100</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-02-16T14:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do I ignore Ctrl-C in ksh scripts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193178#M714101</link>
      <description>If I do a "stty -a" I get this:&lt;BR /&gt;&lt;BR /&gt;# stty -a&lt;BR /&gt;&lt;BR /&gt;                ...&lt;BR /&gt;                intr = ^C; quit = ^\; erase = ^H; kill = ^U&lt;BR /&gt;                eof = ^D; eol = ^@; eol2 = ^@; swtch = ^@&lt;BR /&gt;                stop = ^S; start = ^Q; susp = ^Z; dsusp = ^@&lt;BR /&gt;                werase = ^@; lnext = ^@&lt;BR /&gt;                ...&lt;BR /&gt;&lt;BR /&gt;Does this mean that?:&lt;BR /&gt;...SIGINT is ^C&lt;BR /&gt;...SIGQUIT is ^\&lt;BR /&gt;...SIGKILL is ^U</description>
      <pubDate>Mon, 16 Feb 2004 14:23:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193178#M714101</guid>
      <dc:creator>Stuart Abramson_2</dc:creator>
      <dc:date>2004-02-16T14:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I ignore Ctrl-C in ksh scripts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193179#M714102</link>
      <description>Certainly does Stuart.  I personally would avoid changing this just to stop people breaking out of an application.  It can cause too many headaches should the application fall over sometime or things like that.&lt;BR /&gt; &lt;BR /&gt;I would go with "trap" myself.  Have used it many times and it will do the trick for you.</description>
      <pubDate>Mon, 16 Feb 2004 14:27:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193179#M714102</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-02-16T14:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I ignore Ctrl-C in ksh scripts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193180#M714103</link>
      <description>Yes, although in stty the '^' (caret) indicates Control so that ^C ---&amp;gt; Control-C.&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Feb 2004 14:28:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193180#M714103</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-02-16T14:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I ignore Ctrl-C in ksh scripts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193181#M714104</link>
      <description>Why don't I see "SIGHUP" and "SIGTERM" in my "stty -a"?</description>
      <pubDate>Mon, 16 Feb 2004 14:31:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193181#M714104</guid>
      <dc:creator>Stuart Abramson_2</dc:creator>
      <dc:date>2004-02-16T14:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do I ignore Ctrl-C in ksh scripts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193182#M714105</link>
      <description>You can't send those from a keyboard.  If you want a list of other things you can't send, try "kill -l" (that a lower case L just to make it clear)</description>
      <pubDate>Mon, 16 Feb 2004 14:36:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193182#M714105</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-02-16T14:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I ignore Ctrl-C in ksh scripts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193183#M714106</link>
      <description>Because those signals are not associated with keystrokes. SIGHUP is the 'hangup' signal. Think of "hanging up" the modem -- or powering off the terminal -- there is, of course, no key to press on a terminal if you've done gone and turned the danged rascal off. Similarly, SIGTERM is a system-generated (software) signal most commonly invoked from the shell with a kill -15 PID; there ain't no key associated with it neither.&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Feb 2004 14:38:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193183#M714106</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-02-16T14:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I ignore Ctrl-C in ksh scripts?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193184#M714107</link>
      <description>Worked perfectly.  Thanks all.&lt;BR /&gt;&lt;BR /&gt;  Stuart</description>
      <pubDate>Mon, 16 Feb 2004 14:40:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/how-do-i-ignore-ctrl-c-in-ksh-scripts/m-p/3193184#M714107</guid>
      <dc:creator>Stuart Abramson_2</dc:creator>
      <dc:date>2004-02-16T14:40:31Z</dc:date>
    </item>
  </channel>
</rss>

