LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 08-03-2005, 02:09 PM   #1
consty
Member
 
Registered: Feb 2004
Location: Douala-Cameroun
Distribution: RedHAt 9 ES
Posts: 85

Rep: Reputation: 15
Special characters


Hi,
How can I program characters like ESCAPE, CTL- , ALT+, in a shell script.
Thans for help
 
Old 08-03-2005, 03:28 PM   #2
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 3,989

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
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,
 
Old 08-03-2005, 05:36 PM   #3
rstewart
Member
 
Registered: Feb 2005
Location: Sunnyvale, CA
Distribution: Ubuntu
Posts: 205

Rep: Reputation: 38
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.
 
Old 08-07-2005, 05:53 AM   #4
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

Rep: Reputation: 33
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Special characters problem MartinZ Suse/Novell 5 07-12-2011 09:21 PM
Special Characters SimeonV Suse/Novell 14 07-07-2006 01:29 PM
special characters greenbox Linux - Software 9 12-23-2005 07:33 PM
using special characters one_ro Mandriva 5 11-04-2004 08:52 AM
Dialup and Special Characters ottbr Linux - General 7 01-16-2003 03:31 PM


All times are GMT -5. The time now is 05:01 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration