<?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: Capturing Ctrl + C in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592767#M828034</link>
    <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Use stty to change the intr value at the start and end of script . see stty -a&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Why the trap.How is the script used&lt;BR /&gt;&lt;BR /&gt;see&lt;BR /&gt;&lt;A href="http://www.shelldorado.com" target="_blank"&gt;www.shelldorado.com&lt;/A&gt; for good shell tips&lt;BR /&gt;&lt;BR /&gt;          Steve Steel</description>
    <pubDate>Fri, 29 Jul 2005 08:56:58 GMT</pubDate>
    <dc:creator>Steve Steel</dc:creator>
    <dc:date>2005-07-29T08:56:58Z</dc:date>
    <item>
      <title>Capturing Ctrl + C</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592766#M828033</link>
      <description>I have created a script that is called out of a users .profile when they log in.  In the script I have:&lt;BR /&gt;&lt;BR /&gt;trap 'print "ENTER INFORMATION REQUESTED!"' INT&lt;BR /&gt;trap 'print "ENTER INFORMATION REQUESTED!"' QUIT&lt;BR /&gt;&lt;BR /&gt;And then goes on to ask them for some requested information.  For some reason it's not working correctly and ctrl + c breaks out of it.  I've tried it with trap "" 1 2 3 and that isn't working either.&lt;BR /&gt;&lt;BR /&gt;Any thoughts? Thanks</description>
      <pubDate>Fri, 29 Jul 2005 08:48:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592766#M828033</guid>
      <dc:creator>Radhe Webster</dc:creator>
      <dc:date>2005-07-29T08:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Capturing Ctrl + C</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592767#M828034</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Use stty to change the intr value at the start and end of script . see stty -a&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Why the trap.How is the script used&lt;BR /&gt;&lt;BR /&gt;see&lt;BR /&gt;&lt;A href="http://www.shelldorado.com" target="_blank"&gt;www.shelldorado.com&lt;/A&gt; for good shell tips&lt;BR /&gt;&lt;BR /&gt;          Steve Steel</description>
      <pubDate>Fri, 29 Jul 2005 08:56:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592767#M828034</guid>
      <dc:creator>Steve Steel</dc:creator>
      <dc:date>2005-07-29T08:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Capturing Ctrl + C</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592768#M828035</link>
      <description>The way trap works is, it EITHER ignores the signal (if you use a null argument) OR it runs the command then processes the trap.&lt;BR /&gt;&lt;BR /&gt;eg&lt;BR /&gt;&lt;BR /&gt;trap '' INT&lt;BR /&gt;&lt;BR /&gt;will make it ignore Ctrl-C&lt;BR /&gt;&lt;BR /&gt;trap 'echo test' INT&lt;BR /&gt;&lt;BR /&gt;will make it print the word "test", then exit the program.&lt;BR /&gt;&lt;BR /&gt;You can't have both unfortunately.</description>
      <pubDate>Fri, 29 Jul 2005 08:57:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592768#M828035</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2005-07-29T08:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Capturing Ctrl + C</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592769#M828036</link>
      <description>It's so that our various vendors identify themselves (and we get emailed) when they log onto the system.&lt;BR /&gt;&lt;BR /&gt;The command trap " INT generates syntax errors... should it not be trap "" INT</description>
      <pubDate>Fri, 29 Jul 2005 09:01:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592769#M828036</guid>
      <dc:creator>Radhe Webster</dc:creator>
      <dc:date>2005-07-29T09:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: Capturing Ctrl + C</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592770#M828037</link>
      <description>I was using 2 single-quotes.  I guess you read this as one double-quote?  You can use either a pair of single-quotes or a pair of double-quotes, it doesn't make a difference when using a null string.  When specifying a command your use depends on whether you want shell expansion.</description>
      <pubDate>Fri, 29 Jul 2005 09:10:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592770#M828037</guid>
      <dc:creator>Simon Hargrave</dc:creator>
      <dc:date>2005-07-29T09:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Capturing Ctrl + C</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592771#M828038</link>
      <description>I've gotten it to work by using stty to change the interrupt value, but trapping it is still not working.</description>
      <pubDate>Fri, 29 Jul 2005 09:13:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592771#M828038</guid>
      <dc:creator>Radhe Webster</dc:creator>
      <dc:date>2005-07-29T09:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Capturing Ctrl + C</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592772#M828039</link>
      <description>What shell are you using?&lt;BR /&gt;&lt;BR /&gt;And does it fail when you just use:&lt;BR /&gt;&lt;BR /&gt;trap 'print blah' 2&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 29 Jul 2005 18:38:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/capturing-ctrl-c/m-p/3592772#M828039</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2005-07-29T18:38:14Z</dc:date>
    </item>
  </channel>
</rss>

