<?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: korn shell in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155085#M158293</link>
    <description>I am not sure I understand what you want to do...&lt;BR /&gt;If you want to assign commands to the keys, you'll be stuck with the trap command.&lt;BR /&gt;But if you want to be able to enter those characters, you can do it by using stty and assign other characters to the interrupt and EOF signals:&lt;BR /&gt;stty EOF ^? INTR ^?&lt;BR /&gt;for instance.&lt;BR /&gt;Or you could enter them by first enter a &lt;CTRL&gt;-V.&lt;BR /&gt;&lt;/CTRL&gt;</description>
    <pubDate>Fri, 02 Jan 2004 03:12:50 GMT</pubDate>
    <dc:creator>Elmar P. Kolkman</dc:creator>
    <dc:date>2004-01-02T03:12:50Z</dc:date>
    <item>
      <title>korn shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155084#M158292</link>
      <description>Hi&lt;BR /&gt;    Is there any way to trap keys including interrupts ( like ^C,^D etc) though korn shell commands ? . Is so can someone tell me how ?&lt;BR /&gt;&lt;BR /&gt;I expect answers apart from &lt;BR /&gt;set trap &amp;lt; command &amp;gt; signal&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Jan 2004 02:52:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155084#M158292</guid>
      <dc:creator>Sathish C</dc:creator>
      <dc:date>2004-01-02T02:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: korn shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155085#M158293</link>
      <description>I am not sure I understand what you want to do...&lt;BR /&gt;If you want to assign commands to the keys, you'll be stuck with the trap command.&lt;BR /&gt;But if you want to be able to enter those characters, you can do it by using stty and assign other characters to the interrupt and EOF signals:&lt;BR /&gt;stty EOF ^? INTR ^?&lt;BR /&gt;for instance.&lt;BR /&gt;Or you could enter them by first enter a &lt;CTRL&gt;-V.&lt;BR /&gt;&lt;/CTRL&gt;</description>
      <pubDate>Fri, 02 Jan 2004 03:12:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155085#M158293</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-01-02T03:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: korn shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155086#M158294</link>
      <description>Ok. for instance there ia an application running , if the user iterrupt the run by pressing ^C or ^D , i should be able to not to allow it .</description>
      <pubDate>Fri, 02 Jan 2004 05:08:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155086#M158294</guid>
      <dc:creator>Sathish C</dc:creator>
      <dc:date>2004-01-02T05:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: korn shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155087#M158295</link>
      <description>In that case you could either make the interrupts not accessible (linking them to keys not on the keyboard) with stty or using the trap command.&lt;BR /&gt;Or you could ignore the signals from within the application. And how that can be done depends on the language the application is written in.</description>
      <pubDate>Fri, 02 Jan 2004 05:19:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155087#M158295</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-01-02T05:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: korn shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155088#M158296</link>
      <description>Yes, see:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.ittepic.edu.mx/eBooks/computacion/80oreilly/books/unix2/ksh/ch08_04.htm" target="_blank"&gt;http://www.ittepic.edu.mx/eBooks/computacion/80oreilly/books/unix2/ksh/ch08_04.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.shelldorado.com/goodcoding/tempfiles.html" target="_blank"&gt;http://www.shelldorado.com/goodcoding/tempfiles.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Mic</description>
      <pubDate>Fri, 02 Jan 2004 23:10:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155088#M158296</guid>
      <dc:creator>Mic V.</dc:creator>
      <dc:date>2004-01-02T23:10:23Z</dc:date>
    </item>
    <item>
      <title>Re: korn shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155089#M158297</link>
      <description>Hi Sathish,&lt;BR /&gt;&lt;BR /&gt;what you are actually talking about are "signals", in your example produced by the TTY drivers upon certain key-presses.&lt;BR /&gt;But there are more signals available than just:&lt;BR /&gt;- SIGINT (ususally CTRL-C, ignore it with "trap : 2") &lt;BR /&gt;and &lt;BR /&gt;- SIGQUIT (ususally something like CTRL-\i, ignore it with "trap : 3"):&lt;BR /&gt;&lt;BR /&gt;Those are:&lt;BR /&gt;- in case of serial terminal lines: the BREAK-key (it can generate a SIGINT; turn it off with "stty -brkint")&lt;BR /&gt;- SIGHUP (usually sent to all your processes when your shell exits; ignore it with "trap : 1" or "nohup")&lt;BR /&gt;- SIGWINCH (sent by your local window manager; ignore it using "trap : " and the number as shown by "kill -l")&lt;BR /&gt;&lt;BR /&gt;To "unset" special keys you'll have to assign an impossible key, like "^@" (which would be the codenumber 0, and cannot be generated by PC-keyboards).&lt;BR /&gt;&lt;BR /&gt;Happy new year,&lt;BR /&gt;Wodisch&lt;BR /&gt;</description>
      <pubDate>Sat, 03 Jan 2004 16:14:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155089#M158297</guid>
      <dc:creator>Wodisch</dc:creator>
      <dc:date>2004-01-03T16:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: korn shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155090#M158298</link>
      <description>Hi Sathish,&lt;BR /&gt;&lt;BR /&gt;what you are actually talking about are "signals", in your example produced by the TTY drivers upon certain key-presses.&lt;BR /&gt;But there are more signals available than just:&lt;BR /&gt;- SIGINT (ususally CTRL-C, ignore it with "trap : 2") &lt;BR /&gt;and &lt;BR /&gt;- SIGQUIT (ususally something like CTRL-\, ignore it with "trap : 3"):&lt;BR /&gt;&lt;BR /&gt;Those are:&lt;BR /&gt;- in case of serial terminal lines: the BREAK-key (it can generate a SIGINT; turn it off with "stty -brkint")&lt;BR /&gt;- SIGHUP (usually sent to all your processes when your shell exits; ignore it with "trap : 1" or "nohup")&lt;BR /&gt;- SIGWINCH (sent by your local window manager; ignore it using "trap : " and the number as shown by "kill -l")&lt;BR /&gt;&lt;BR /&gt;To "unset" special keys you'll have to assign an impossible key, like "^@" (which would be the codenumber 0, and cannot be generated by PC-keyboards).&lt;BR /&gt;&lt;BR /&gt;Happy new year,&lt;BR /&gt;Wodisch&lt;BR /&gt;</description>
      <pubDate>Sat, 03 Jan 2004 16:15:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155090#M158298</guid>
      <dc:creator>Wodisch</dc:creator>
      <dc:date>2004-01-03T16:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: korn shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155091#M158299</link>
      <description>sorry for the re-transmission of my posting :-(</description>
      <pubDate>Sat, 03 Jan 2004 16:16:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155091#M158299</guid>
      <dc:creator>Wodisch</dc:creator>
      <dc:date>2004-01-03T16:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: korn shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155092#M158300</link>
      <description>Hi Wodisch &lt;BR /&gt;                Thank you the for your responce. The application that I have is a one hell of long smart korn shell with bit of Tcl/Tk , its basically a menu system that branches into lots of sub-menues and so on , it is designed to handle all the charcters and numbers during the input validation but for any interrupts via ^C,^D or any other combinations I am not able to control them . For instance I do not want the user to exit the program until the program exits himself . But I have already tried set trap option , bit I amo not sure how to ignore them .&lt;BR /&gt;&lt;BR /&gt;set trap "echo Pls You Can Not Log Out Now":0&lt;BR /&gt;&lt;BR /&gt;But this is not going to redo the real action of  the interrupt 0 , but it also does the echo message along with the default action of interrupt 0 .&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Jan 2004 01:20:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155092#M158300</guid>
      <dc:creator>Sathish C</dc:creator>
      <dc:date>2004-01-05T01:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: korn shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155093#M158301</link>
      <description>Written out you can solve your problem as shown below. The stty -g is necessary because otherwise your terminal setting would be garbled after the script is ready. With the -g options and later using that output you save and restore the settings.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;OLDSTTY=`stty -g`&lt;BR /&gt;stty intr ^@&lt;BR /&gt;stty eof ^@&lt;BR /&gt;stty kill ^@&lt;BR /&gt;stty -brkint&lt;BR /&gt;trap "echo Please let me run" 0 1 2 3 4 5 6 7 8&lt;BR /&gt;&lt;BR /&gt;&lt;YOUR script=""&gt;&lt;/YOUR&gt;&lt;BR /&gt;stty $OLDSTTY&lt;BR /&gt;trap "" 0 1 2 3 4 5 6 7 8&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Jan 2004 02:03:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155093#M158301</guid>
      <dc:creator>Elmar P. Kolkman</dc:creator>
      <dc:date>2004-01-05T02:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: korn shell</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155094#M158302</link>
      <description>Hi&lt;BR /&gt;       This is cool . I have tried it now , except the echo message that is not getting displayed for instance when I press ^C , else is fine , the signals are getting ignored .&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thank you all&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Jan 2004 02:12:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/korn-shell/m-p/3155094#M158302</guid>
      <dc:creator>Sathish C</dc:creator>
      <dc:date>2004-01-05T02:12:45Z</dc:date>
    </item>
  </channel>
</rss>

