@ in a HPux shell script

coupland used Ask the Experts™
how do I input a @ in vi to be used in a unix shell script.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Put the following in your .profile or .cshrc:

stty erase "^H" kill "^U" intr "^C" eof "^D"

and relogin (or source .cshrc or run the .profile) then you can use vi to type in the @ key !

or type in:
stty erase "^H" kill

before using vi

By default, HP-UX uses the old, old, original UNIX erase and kill characters of # and @. You can reset the erase and kill characters as yuzh has explained to get around this -- but there's never any requirement to relogin...you can just run the command he gave in your current shell.

If you don't want to take that approach, you can still enter these characters in vi by judicious use of backslash and ctrl-V. As best I can recall, you need both -- one to get past the tty driver and the other to get past vi's re-interpretation and I think the order is \ then ctrl-V, but it could be the other way around (I don't have a HP-UX system readily to hand these days to test on).
I think I did make my command clear enough.

What I means is that:

You  can type in :

stty erase "^H" kill

then use vi


put them in your login file (.profile, .cshrc etc), you can run the login file, or choose to relogin.

just to complete yuzh's suggestion:
 if you write the stty in your rc-files (.profile, ,cshrc, etc.), make shure that these commands are executed in a tty session only (shell login), and that it is done for HP-UX only.
Otherwise you feed new dragons ..
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: yuzh {http:#7476225} & jmcg {http:#7476448}

Please leave any comments here within the next four days.

EE Cleanup Volunteer

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial