@ character has aberrant behavior


 
Thread Tools Search this Thread
Operating Systems HP-UX @ character has aberrant behavior
# 1  
Old 03-05-2014
@ character has aberrant behavior

This has been bedeviling me.

When I enter the @ character (not ^@) the following occurs:

(1) at the csh prompt: nothing and the @ does not displya

(2) within sqlplus
- @ displays
- it puts me on a new line (as if continuing the previous one)
- if I try to complete the sql command it complains of an invalid character
stty -a shows me nothing that I can see (reproduced below). It's using xterm but I did a setenv TERM vt100 and it didn't matter.
Code:
% stty -a
speed 38400 baud; line = 0;
rows = 69; columns = 80
min = 1; time = 1;
intr = ^C; quit = ^\; erase = ^H; kill = @
eof = ^D; eol = ^@; eol2 <undef>; swtch <undef>
stop = ^S; start = ^Q; susp = ^Z; dsusp <undef>
werase <undef>; lnext <undef>
-parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -crts
-ignbrk brkint -ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon ixany -ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
-echoctl -echoprt -echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop tab3
%

Moderator's Comments:
Mod Comment Please use code tags for your code and data

Last edited by vbe; 03-05-2014 at 06:25 PM.. Reason: code tags
# 2  
Old 03-05-2014
Quote:
Originally Posted by yirgster
This has been bedeviling me.

When I enter the @ character (not ^@) the following occurs:

(1) at the csh prompt: nothing and the @ does not displya

(2) within sqlplus
- @ displays
- it puts me on a new line (as if continuing the previous one)
- if I try to complete the sql command it complains of an invalid character
stty -a shows me nothing that I can see (reproduced below). It's using xterm but I did a setenv TERM vt100 and it didn't matter.
% stty -a
speed 38400 baud; line = 0;
rows = 69; columns = 80
min = 1; time = 1;
intr = ^C; quit = ^\; erase = ^H; kill = @
eof = ^D; eol = ^@; eol2 <undef>; swtch <undef>
stop = ^S; start = ^Q; susp = ^Z; dsusp <undef>
werase <undef>; lnext <undef>
-parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -crts
-ignbrk brkint -ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon ixany -ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
-echoctl -echoprt -echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop tab3
%
When you set the kill character for your terminal input to be the @ sign, the behavior you are describing is exactly what you should expect. Most people now set their kill character to be the keyboard combination of holding down the control key and hitting the u key (which stty would show as ^U).
# 3  
Old 03-05-2014
Thx!

I mean, that was sort of obvious. (What an understatement!)

---------- Post updated at 05:32 PM ---------- Previous update was at 02:55 PM ----------

Here's my next question: why would HP do this? I mean, take over a regular character to use as a control character? This seems sort of lunatic.

It's not like there aren't alternatives like the ^U you suggested which is what linux has for xterm.
# 4  
Old 03-05-2014
On early UNIX systems (with ASR-33 Teletypes as hardcopy (not CRT, LED, LCD, ...) terminals), the default ERASE and KILL characters were # and @, respectively. The default characters used when you open a terminal device are set to system defaults (not terminal type defaults). The stty(1) man page on your system probably specifies what the defaults are on your system. If you don't like the defaults, add an stty command to your .profile (or similar shell initialization file for your login shell) to set the characters you want to use.
These 2 Users Gave Thanks to Don Cragun For This Post:
# 5  
Old 03-06-2014
Thank you for the history. It was very interesting.

I put a setting in my .cshrc after your first email. I noticed I already had added stty's for intr and susp.

Which brings me to:

I would have thought that HP might have considered revising their default settings after a while. I mean, teletypes ...
# 6  
Old 03-06-2014
Is this why HP-UX doesn't work very setting password with @ then? We're always being told to make password more complex, yet people like the @ and it works for AIX, RHEL, Windows AD, ....... but has a problem with HP-UX.


Thanks,
Robin
# 7  
Old 03-06-2014
Quote:
Originally Posted by rbatte1
Is this why HP-UX doesn't work very setting password with @ then? We're always being told to make password more complex, yet people like the @ and it works for AIX, RHEL, Windows AD, ....... but has a problem with HP-UX.
Yeah, the fact that @ is acting as a line kill character does indeed cause problems with passwords containing a @ character. You can't reset your kill character until after you login and run an stty command. However, see this old thread for a solution...
https://www.unix.com/showthread.php?t=19429
These 3 Users Gave Thanks to Perderabo For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to remove newline character if it is the only character in the entire file.?

I have a file which comes every day and the file data look's as below. Vi abc.txt a|b|c|d\n a|g|h|j\n Some times we receive the file with only a new line character in the file like vi abc.txt \n (8 Replies)
Discussion started by: rak Kundra
8 Replies

2. Shell Programming and Scripting

sed searches a character string for a specified delimiter character, and returns a leading or traili

Hi, Anyone can help using SED searches a character string for a specified delimiter character, and returns a leading or trailing space/blank. Text file : "1"|"ExternalClassDEA519CF5"|"Art1" "2"|"ExternalClass563EA516C"|"Art3" "3"|"ExternalClass305ED16B8"|"Art9" ... ... ... (2 Replies)
Discussion started by: fspalero
2 Replies

3. UNIX for Advanced & Expert Users

"╭─ " Character combo in $PATH causes strange autocompletion behavior in zsh

I've posted about this before, but only recently narrowed the problem down to a specific cause. Ok, first of all, the behavior: It occurs when autocompletion brings up its list (not when there is only a single option). Basically, if I were to type, say, cd ~/<TAB> I would get something... (2 Replies)
Discussion started by: marshaul
2 Replies

4. Shell Programming and Scripting

In Sed how can I replace starting from the 7th character to the 15th character.

Hi All, Was wondering how I can do the following.... I have a String as follows "ACCTRL000005022RRWDKKEEDKDD...." This string can be in a file called tail.out or in a Variable called $VAR2 Now I have another variable called $VAR1="000004785" (9 bytes long), I need the content of... (5 Replies)
Discussion started by: mohullah
5 Replies

5. Shell Programming and Scripting

read the text file and print the content character by character..

hello all i request you to give the solution for the following problem.. I want read the text file.and print the contents character by character..like if the text file contains google means..i want to print g go goo goog googl google like this Using unix Shell scripting... without using... (1 Reply)
Discussion started by: samupnl
1 Replies

6. UNIX for Advanced & Expert Users

if 4th and 5th character of sting -ge 45 then add 1 to 3rd character

I want to know how to, given a string like W87151WR71C, if the 4th and 5th character (in this case 15) are greater than 45, then to add 1 to the 3rd character (in this case 7) and assign the revised string the variable name MODSTRING. Thanks in advance. This is ultimately to grab info from... (6 Replies)
Discussion started by: glev2005
6 Replies

7. Shell Programming and Scripting

Deleting all characters from 350th character to 450th character from the log file

Hi All, I have a big log file i want to delete all characters (between 350th to 450th characters) starting at 350th character position to 450th character position. please advice or sample code. (6 Replies)
Discussion started by: rajeshorpu
6 Replies

8. Shell Programming and Scripting

read in a file character by character - replace any unknown ASCII characters with spa

Can someone help me to write a script / command to read in a file, character by character, replace any unknown ASCII characters with space. then write out the file to a new filename/ Thanks! (1 Reply)
Discussion started by: raghav525
1 Replies

9. UNIX for Dummies Questions & Answers

read a variable character by character, substitute characters with something else

im having trouble doing this: i have a variable with 2 characters repeating e.g. aababbbaaaababaabbaabbba is there a way i can search the variable for a's and b's and then change a's to b's and b's to a's? im guessing its like getting the 1's compliment of the string im doing this in... (2 Replies)
Discussion started by: vipervenom25
2 Replies

10. Programming

ls behavior

I put this here because it is a 'behavior' type question.. I seem to remember doing ls .* and getting all the .-files, like .profile .login etc. But ls .* doesn't do that, it lsts the contents of every .*-type subdirectory. Is it supposed to? I should think that a -R should be given to... (10 Replies)
Discussion started by: AtleRamsli
10 Replies
Login or Register to Ask a Question