Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So I found something somewhat interesting in ksh. I found that if the last character is \, then immediately backspace, the charcter becomes recplaced with ^H. I am then able to press backspace again to clear it away.

What kind of wizardry am I dealing with here? Is this a bug? Trying this in bash did not yield the same result.

share|improve this question
    
The OS is AIX 5.3. Not sure what version of ksh (looking now), but what I mean is that the very last symbol is literally \ . I forgot the context in which I found myself backspacing \ , but I tried it again later and found the same thing.. –  hydroparadise Aug 16 '12 at 19:32
    
I reproduced it in ksh93 on Linux, and all I needed was set -o vi –  Alan Curry Aug 16 '12 at 21:55

1 Answer 1

up vote 1 down vote accepted

It's intentional, although I won't disagree about it being weird. When vi or emacs mode is enabled (set -o vi or set -o emacs) ksh provides this feature (which is present in neither vi nor emacs as far as I know) where the backslash quotes a following control character.

It's like the lnext character (Ctrl-V) but weaker. You can enter a literal backspace this way, but to enter a literal ^C you need the ^V first.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.