Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Whenever I type a mistake into my SCO machine, using bash, I press backspace and it is like pressing enter, but doesn't execute the command.

e.g.

bash-3.1$ ifcomfig "(backspace)"
bask-3.1$ 

But if I pressed enter, then it would be like this:

bash-3.1$ ifcomfig "(enter)"
bash: ifcomfig: command not found
  • Why is it doing this?
  • And how can I fix this?

Thank you

Update

Here is the output of stty -a:

speed 38400 baud;   ispeed 38400 baud;   ospeed 38400 baud;   line = 0(tty);
rows = 100; columns = 92; ypixels = 0; xpixels = 0;
intr = DEL; quit = ^\; erase = DEL; kill = ^U; eof = ^D; eol = ^@;
swtch = <undef>; susp = <undef>; start = ^Q; stop = ^S;
-parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk
-ortsfl -ctsflow -rtsflow
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
-ixon -ixany -ixoff
isig icanon -xcase echo -echoe -echok -echonl -noflsh
-iexten -tostop -xclude
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel
-isscancode
-autoe -ed_emacs -ed_vi -ed_history
share|improve this question
1  
Could you post the output of stty -a? –  djf Aug 16 '12 at 9:52
    
Updated description. –  Kevdog777 Aug 16 '12 at 10:02
    
I see that it shows: erase = DEL, but the Delete button adds a ~ to the line. I'm not sure that is what is meant by: erase = DEL though. –  Kevdog777 Aug 16 '12 at 10:04

1 Answer 1

up vote 5 down vote accepted

It's possible that the backspace key on the keyboard may actually be generating the DEL character. That's sort of confirmed by the fact that both intr and erase are set to DEL according to your stty -a output. I have no idea which one would be given priority in that case since I've never been foolish enough to try it :-) (a)

A quick way to confirm would be to enter:

stty intr '^C'

in your terminal session, which will change it to CTRL-C and then see what backspace does.

If that then starts working okay, you need to find where the intr keystroke is being set and stop it from happening, or just set it to ^C as the last thing in your profile (overriding the errant setting).


(a) Although, actually, I've just given it a shot by setting both my intr and erase to ^? (my backspace character), and the interrupt nature takes over.

share|improve this answer
    
Genius!!! Thank you, it has worked properly now. –  Kevdog777 Aug 16 '12 at 10:12
1  
@paxdiablo Beat me to it : ) –  djf Aug 16 '12 at 10:13
1  
Sorry, @djf, I don't normally hang out here (I'm an SO guy mostly), I just came over to check up on my SLES11 question and got carried away :-) –  paxdiablo Aug 16 '12 at 10:15
    
@djf, haha I knew you were going to give an answer. But thanks for asking me for that stty -a –  Kevdog777 Aug 16 '12 at 10:16
1  
@Kev, you need to look into what profile scripts are running when you "log on". Whether .profile, .bash_profile, .bashrc and a host of other files are run is controlled by how you're logging on and off (eg. via text mode or gdm for example). Bottom line, if you "log in" and stty -a shows the old setting, then .profile wasn't run. That's a totally different problem. Unfortunately, I have no experience with SCO UNIX. –  paxdiablo Aug 16 '12 at 10:33

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.