Use BackSpace Key to Erase characters instead of Delete Key

Contributor Icon Contributed by indianboy Date Icon October 7, 2003  
Tag Icon Tagged: Solaris system administration

Normally when you access Solaris in text mode , for erasing a character the Delete Key has to be used . To use the BackSpace key instead …….


Normally when you access Solaris in text mode , for erasing a character the Delete Key has to be used and if you use the BackSpace Key . To use the BackSpace key instead …..

Please enter the following at the prompt

stty erase ^H

But once u log out of the system and login again the changes are lost and if u want to retain them even after ur logout .

If u are using sh or ksh

Please add the above mentioned line to the .profile
file

If u are using csh

Please add the line to .login file

If u are using bash shell

Please add the file to .bash_profile file .

Previous recipe | Next recipe |
 
  • mhobbs13
    I tried this on my Sun Solaris box after I put stty erase ^H in the .profile I then save the .profile and logout then log back in and I see this -sh: H: not found and I still get ^H when I try to back-space. Can anyone help.
    thanks,
    Michael Hobson
    michael.hobson@its.state.ms.us
  • qmchenry
    The trick in describing this is that what you see is not what you type. Frequently, editors interpret the backspace (CTRL-H) key as a backspace, even if the shell doesn't. So when you edit the file, you need to escape the control character. If the code is copied and pasted, the literal characters "^" and "H" will be pasted, and this is certainly not what is needed. In an editor, the literal characters ^H and the ^H representing a backspace look the same (although the literal characters are two characters while the backspace ^H is treated as one character while moving the cursor around).

    There are two ways I know of to do this. If you preceed a control character with CTRL-V, the control character will be escaped. For example, pressing CTRL-V and then BACKSPACE will yield a ^H on the screen which represents a CTRL-H. The backslash character () will also escape a control character, so you can type BACKSPACE and you'll also see ^H.

    Let us know if this doesn't help.
    Quinn
  • siva
    the solution worked. Here it little more clarification on how to set it in .profile. first at the $ prompt type stty erase BACKSPACE, then copy this line and add it to the .profile. Directly typing BACKSPACE in the .profile is not working.

    thanks,
    siva
  • its me
    i tried this from # prompt, but its in vein. error: "H: not found". i entered it exactly as you mentioned.
  • angelko
    you should use the following:
    stty erase ^?

    the ^H version is also correct but it works on a different term/keyboard setup.

    =angelko
  • Newbie
    This solved it for me thanks
blog comments powered by Disqus