DISQUS

DISQUS Hello! Tech-Recipes is using DISQUS, a powerful comment system, to manage its comments. Learn more.

Community Page

Tech-Recipes

Cookbook of Tech Tutorials
Jump to original thread »
Author

Use BackSpace Key to Erase characters instead of Delete Key | Solaris system administration | Tech-Recipes

Started by qdideas · 9 months ago

No excerpt available. Jump to website »

6 comments

  • 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
  • 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
  • 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
  • i tried this from # prompt, but its in vein. error: "H: not found". i entered it exactly as you mentioned.
  • you should use the following:
    stty erase ^?

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

    =angelko
  • This solved it for me thanks

Add New Comment

Returning? Login