What is the literal for cntrl+c - kill process (like ^[ is a literal escape). I need to code this literal in here document of one of shell script to get exit the control.
SOme one please help me.. :(
What is the literal for cntrl+c - kill process (like ^[ is a literal escape). I need to code this literal in here document of one of shell script to get exit the control.
SOme one please help me.. :(
I guess you mean the
^C
character sequence?The ASCII code for ctrl-C is 3; it is often represented as
^C
but this is just a human representation consisting of the two characters^
andC
.In legacy character sets, the control characters often had a graphical representation, so on an old IBM PC (CP437) you would see a heart glyph ♥ if you looked at a file containing this character. In Unicode, it simply has no representation at all although some fonts contain a small box with the characters "ETX" in it (the "end of text" semantics from ASCII are purely historical, however). In my browser, <<>> is simply the empty string, but yours might show something else between the angle brackets.
Putting a ctrl-C in a here document will nevertheless not generate a signal; the signal is generated by the interactive terminal driver when it receives this character (and the character can be reconfigured easily;
man stty
). When the shell parses a here document, the terminal driver is not involved at all.To send a signal from a script, use the
kill
command.