LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Special characters (https://www.linuxquestions.org/questions/programming-9/special-characters-349667/)

consty 08-03-2005 02:09 PM

Special characters
 
Hi,
How can I program characters like ESCAPE, CTL- , ALT+, in a shell script.
Thans for help

schneidz 08-03-2005 03:28 PM

this might help:

schneidz@lq> echo 55"\012" 6
55
6
schneidz@lq> echo 55"\010" 6
5 6


"\012" is the octal for line feed. and "\010" is the octal for backspace.

good luck,

rstewart 08-03-2005 05:36 PM

Hi,

If you are using the vi (vim) editor, you can hit "control-v" followed by the character you want while in insert mode. "Control-v" instructs vi to take the next character literally. So for an escape you would type control-v and press the esc key, for CTL+ you would hit control-v and then press control-+, etc.

eddiebaby1023 08-07-2005 05:53 AM

Quote:

Originally posted by schneidz
this might help:

schneidz@lq> echo 55"\012" 6
55
6
schneidz@lq> echo 55"\010" 6
5 6


"\012" is the octal for line feed. and "\010" is the octal for backspace.

good luck,

You'll probably need the -e flag to echo if you want these to work in modern Linux.


All times are GMT -5. The time now is 12:16 PM.