<?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 Control-C in here document (scripting) in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250272#M175239</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;How do I sent a control-c (^c)&lt;BR /&gt;&lt;BR /&gt;from a here document within a script.&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;function SWITCH {&lt;BR /&gt;   exec &amp;gt;&amp;gt; //log/test.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;   set -x&lt;BR /&gt;   date&lt;BR /&gt;exec telnet ${1} &amp;lt;&amp;lt; EOF&lt;BR /&gt;admin&lt;BR /&gt;login&lt;BR /&gt;^c  (not working like this)&lt;BR /&gt;date; portperfshow 30&lt;BR /&gt;EOF&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;SWITCH &lt;IP-ADRES&gt;&lt;BR /&gt;SWITCH &lt;IP-ADRES2&gt;&lt;BR /&gt;&lt;/IP-ADRES2&gt;&lt;/IP-ADRES&gt;</description>
    <pubDate>Fri, 16 Apr 2004 07:27:52 GMT</pubDate>
    <dc:creator>Clemens van Everdingen</dc:creator>
    <dc:date>2004-04-16T07:27:52Z</dc:date>
    <item>
      <title>Control-C in here document (scripting)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250272#M175239</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;How do I sent a control-c (^c)&lt;BR /&gt;&lt;BR /&gt;from a here document within a script.&lt;BR /&gt;&lt;BR /&gt;#! /usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;function SWITCH {&lt;BR /&gt;   exec &amp;gt;&amp;gt; //log/test.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;   set -x&lt;BR /&gt;   date&lt;BR /&gt;exec telnet ${1} &amp;lt;&amp;lt; EOF&lt;BR /&gt;admin&lt;BR /&gt;login&lt;BR /&gt;^c  (not working like this)&lt;BR /&gt;date; portperfshow 30&lt;BR /&gt;EOF&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;SWITCH &lt;IP-ADRES&gt;&lt;BR /&gt;SWITCH &lt;IP-ADRES2&gt;&lt;BR /&gt;&lt;/IP-ADRES2&gt;&lt;/IP-ADRES&gt;</description>
      <pubDate>Fri, 16 Apr 2004 07:27:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250272#M175239</guid>
      <dc:creator>Clemens van Everdingen</dc:creator>
      <dc:date>2004-04-16T07:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: Control-C in here document (scripting)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250273#M175240</link>
      <description>May be kill -SIGINT in your script.&lt;BR /&gt;&lt;BR /&gt;Anil</description>
      <pubDate>Fri, 16 Apr 2004 07:49:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250273#M175240</guid>
      <dc:creator>RAC_1</dc:creator>
      <dc:date>2004-04-16T07:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Control-C in here document (scripting)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250274#M175241</link>
      <description>Did not work !&lt;BR /&gt;&lt;BR /&gt;Same problem.</description>
      <pubDate>Fri, 16 Apr 2004 08:12:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250274#M175241</guid>
      <dc:creator>Clemens van Everdingen</dc:creator>
      <dc:date>2004-04-16T08:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Control-C in here document (scripting)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250275#M175242</link>
      <description>Why exactly do you want a ^C in here?&lt;BR /&gt; &lt;BR /&gt;If it is to stop something running, and you want the result of the date and portperfshow command then can't you just use a different account that doesn't start this application in the .profile and perhaps use remsh.</description>
      <pubDate>Fri, 16 Apr 2004 08:33:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250275#M175242</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-04-16T08:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Control-C in here document (scripting)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250276#M175243</link>
      <description>If not using ^c we need to change the passwords&lt;BR /&gt;&lt;BR /&gt;The message is this:&lt;BR /&gt;&lt;BR /&gt;Password: &lt;BR /&gt;Please change your passwords now.&lt;BR /&gt;Use Control-C to exit or press 'Enter' key to proceed.&lt;BR /&gt;&lt;BR /&gt;If enter the we need to change the passwords.&lt;BR /&gt;We don't want to do that.</description>
      <pubDate>Fri, 16 Apr 2004 08:51:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250276#M175243</guid>
      <dc:creator>Clemens van Everdingen</dc:creator>
      <dc:date>2004-04-16T08:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Control-C in here document (scripting)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250277#M175244</link>
      <description>Ok, if you are editing this script with "vi" you could try inserting a real control C with CTRL-V CTRL-C.  This will give you a real CTRL C.&lt;BR /&gt; &lt;BR /&gt;You might consider using "expect" instead.</description>
      <pubDate>Fri, 16 Apr 2004 08:58:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250277#M175244</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-04-16T08:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Control-C in here document (scripting)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250278#M175245</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;As far as I know to insert a control character in vi, when you are in insert mode type ctrl v and then ctrl c and ^C will be recognised.&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;&lt;BR /&gt;Peter</description>
      <pubDate>Fri, 16 Apr 2004 08:58:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250278#M175245</guid>
      <dc:creator>Peter Leddy_1</dc:creator>
      <dc:date>2004-04-16T08:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Control-C in here document (scripting)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250279#M175246</link>
      <description>login is really expecting a SIGINT, not a control character.&lt;BR /&gt;&lt;BR /&gt;When you're doing it interactively, the effect of pressing ^C is to send SIGINT to the foreground process group.&lt;BR /&gt;&lt;BR /&gt;This is handled directly by the tty driver, which delivers the signal (similarly for other control combinations, like ^Z, sending SIGTSTP -- this is configurable via stty(1)).&lt;BR /&gt;&lt;BR /&gt;When reading from a heredoc, there is no tty involved (stdin is a pipe, not a tty device), so the raw ^C character gets passed through to login.  No signals are sent.</description>
      <pubDate>Fri, 16 Apr 2004 15:54:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250279#M175246</guid>
      <dc:creator>Timothy Cole_1</dc:creator>
      <dc:date>2004-04-16T15:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Control-C in here document (scripting)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250280#M175247</link>
      <description>Actually what's happening is a little more complicated than that (but not much), since you have telnet involved.&lt;BR /&gt;&lt;BR /&gt;When telnet(1) receives a SIGINT from the terminal driver, it sends an _out of band_ sequence indicating the interrupt to the remote telnetd, which then sends a SIGINT to its own children (or does the equivalent on that OS).&lt;BR /&gt;&lt;BR /&gt;As before, including a literal ^C in stdin will just result in the remote process recieving a literal ^C, rather than the expected SIGINT.&lt;BR /&gt;&lt;BR /&gt;I'm not sure there's an easy solution -- you'd need to write something to parse telnet(1)'s stdout and send a SIGINT to it at the appropriate moment.&lt;BR /&gt;&lt;BR /&gt;It might be less work to change the admin password by hand once so it doesn't complain.&lt;BR /&gt;&lt;BR /&gt;If it's possible, I'd really recommend using SSH with public key authentication instead of telnet -- it's much more secure and you don't have to worry about passwords then.</description>
      <pubDate>Fri, 16 Apr 2004 16:09:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250280#M175247</guid>
      <dc:creator>Timothy Cole_1</dc:creator>
      <dc:date>2004-04-16T16:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: Control-C in here document (scripting)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250281#M175248</link>
      <description>I tried all the suggestions, but indeed none of them is really working.&lt;BR /&gt;&lt;BR /&gt;So I ended up changing the passwords.&lt;BR /&gt;&lt;BR /&gt;Thanks for the suggestions.&lt;BR /&gt;Clemens</description>
      <pubDate>Mon, 19 Apr 2004 00:42:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/control-c-in-here-document-scripting/m-p/3250281#M175248</guid>
      <dc:creator>Clemens van Everdingen</dc:creator>
      <dc:date>2004-04-19T00:42:23Z</dc:date>
    </item>
  </channel>
</rss>

