Escape Sequence for Capital Letters Input at Shell Not Working | Unix Linux Forums | Solaris

  Go Back    


Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle.

Escape Sequence for Capital Letters Input at Shell Not Working

Solaris


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 06-12-2013
rstor rstor is offline
Registered User
 
Join Date: Jun 2013
Last Activity: 16 June 2013, 2:33 PM EDT
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
Escape Sequence for Capital Letters Input at Shell Not Working

Hello,

I am running Solaris 8. When issuing the command "stty lcase" all text which is output to the terminal are capitalized. Letters that are supposed to be capitals are preceded by a backslash during output. All text which is input is converted to lower case. This is the expected behaviour to my understanding of "stty lcase".

According the documentation for termio(7I) it mentions that "If XCASE is set and ICANON is set, an upper case letter is accepted on input if preceded by a backslash (`\')"

Problem:

I have confirmed that both xcase and icanon are set. However; at the shell, when trying to enter a capital letter (such as the capital letter "A") using the escape sequence: \A, the shell interprets it as a lower case letter "a". What do I need to do in order to be able to enter capital letters at the shell when "stty lcase" is set? The terminal that I will eventually be using is an ASR-33 Teletype that can only handle capital letters (input and output).

Interestingly, using the vi editor, the escape sequence works. If I enter a backslash it does not echo back immediately. When I follow the backslash by a second character such as the letter A, both the backslash and the letter A are echoed back, and is stored in the saved file as a capital letter "A". Is it possible to have the shell behave in the same manner?
Sponsored Links
    #2  
Old 06-12-2013
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 18 December 2014, 4:59 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,560
Thanks: 8
Thanked 562 Times in 537 Posts
Vi knows what to flip, so
Code:
:!stty -a

and start flipping things?

Last edited by jim mcnamara; 06-12-2013 at 07:24 PM..
Sponsored Links
    #3  
Old 06-12-2013
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 20 December 2014, 10:44 PM EST
Location: NM
Posts: 10,313
Thanks: 297
Thanked 822 Times in 764 Posts
Did you Try:
Code:
ctrl-V[capital letter]
#Example of what it looks like:
^VH

The Following User Says Thank You to jim mcnamara For This Useful Post:
rstor (06-13-2013)
    #4  
Old 06-13-2013
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 18 December 2014, 4:59 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,560
Thanks: 8
Thanked 562 Times in 537 Posts
Normally, ctrl strips off the bits that say lower case and upper case, driving key codes into the lower 32 places, so ctrl-@ is 0x00, ctrl-A is 0x01, etc., but keyboards can be programmed to do other things. However, ctrl-V is the escape character for the tty cook, so it opens up additional possibilities.
The Following User Says Thank You to DGPickett For This Useful Post:
rstor (06-13-2013)
Sponsored Links
    #5  
Old 06-13-2013
rstor rstor is offline
Registered User
 
Join Date: Jun 2013
Last Activity: 16 June 2013, 2:33 PM EDT
Posts: 7
Thanks: 2
Thanked 0 Times in 0 Posts
@Jim:

Ctrl+V[capital letter] works!

(Currently I am testing this on a PC and will eventually interface an ASR33):

At fist, since everything was being output in capital letters regardless of input (stty lcase) it threw me off. When I pressed ctrl+V followed by a letter (which was input in lower case and output as capital) it did *not* work.

I then pressed control+v followed by a capital letter (such as shift+F) which resulted in the following output: \F

Thank you Jim and DGPickett!

I would like to understand why this works:

stty -a indicates that LNEXT is mapped to ctrl+v.

According to the documentation of termio(7I) it mentions the following:

termio(7I)
"LNEXT (Control-v or ASCII SYN) causes the special meaning of the next character to be ignored"

@DGPickett:
You mentioned that ctrl+v is the escape character for the tty cooked mode.

Does this mean that the character typed following control+v is interpreted by the terminal driver in raw mode (i.e. the special meaning of next character ignored). Therefore processing such as that set by stty lcase (viz. iuclc) is skipped and therefore the character is taken in as an actual capital letter (and output as a formated \F [in my test above] as XCASE and ICANON are set)? Is this how it works?

Thank you.

Last edited by rstor; 06-13-2013 at 02:45 PM..
Sponsored Links
    #6  
Old 06-13-2013
DGPickett DGPickett is offline Forum Advisor  
Registered User
 
Join Date: Oct 2010
Last Activity: 18 December 2014, 4:59 PM EST
Location: Southern NJ, USA (Nord)
Posts: 4,560
Thanks: 8
Thanked 562 Times in 537 Posts
You got it, L for Literal. Also handy for embedding line feeds in command lines, with appropriate quoting.

BTW, if vi allows Caps, running ksh in 'set -o vi' and $EDITOR=vi mode means you can take any command line to vi with esc-v. I find this and expanded command history $HISTSIZE=32767 make for great keystroke savings, so I never cd except inside (), and all the commands I recall work over and over.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
changing all characters of a file to capital letters majid.merkava Shell Programming and Scripting 6 09-29-2011 08:12 AM
How to search for capital letters djdaniel3 UNIX for Dummies Questions & Answers 1 04-06-2008 10:05 AM
change small letters to capital atticus Shell Programming and Scripting 16 06-13-2006 11:35 PM
Change a parameter to be in capital letters n8575 Shell Programming and Scripting 4 02-08-2006 06:43 AM
capital letters GONE! blogg UNIX for Dummies Questions & Answers 8 12-11-2002 09:44 PM



All times are GMT -4. The time now is 11:48 AM.