problem using arrow keys in bash shell


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 07-16-2009
problem using arrow keys in bash shell

hello everybody,
as many, I have a problem with a script...

I wrote a shell script in which I want to read a variable value. the problem is that I can't use the arrow keys.
Here is the script I use :

#!/bin/bash
stty erase ^H


read foune

echo "$foune"
exit 0;



the problem is that if the user ( or me..) wants to correct what he wrote, he can't use the arrow keys ( i had the same problem with backspace but i fixed it with
stty erase ^H).
Instead it print "value^[[D" (the ^[[D is when i use left arrow key)

I don't know if I have been clear enough, but if someone understand my problem...Smilie
Thanks

Last edited by Moumou; 07-16-2009 at 05:46 AM..
# 2  
Old 07-16-2009
The "stty erase ^H" when entered correctly causes the backspace to do backspaces instead of the del key, this does not affect the behavior of the left arrow key.
# 3  
Old 07-17-2009
yeah, i know that it affect only the backspace. My problem is that I can't use the left and right arrow keys.
At first, when I typed on backspace that was echoing "^H" instead of deleting the char.
Now i fixed these problem with the "stty erase..".
And so now I'm searching for a way to do the same thing with the arrow keys... and it seems pretty hard!
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Read a multiline text from a console - supporting arrow keys wenclu Shell Programming and Scripting 8 10-16-2012 01:51 AM
Arrow keys binding in AIX v5.3 - how? alex_5161 UNIX for Dummies Questions & Answers 2 12-22-2011 06:40 PM
Tux-HJKL as arrow keys dotancohen UNIX for Dummies Questions & Answers 2 09-01-2011 04:14 PM
Use arrow touch in a script shell without special character khalidou13 Shell Programming and Scripting 0 01-13-2010 09:01 AM
SSH closes connection when using arrow keys stv_t UNIX for Advanced & Expert Users 0 09-17-2009 06:53 AM
Using arrow keys in shell scripts cambridge Shell Programming and Scripting 4 05-26-2009 06:15 AM
[Bash] Send Keys help mikejreading Shell Programming and Scripting 3 03-22-2009 10:22 PM
How does BASH handle KEY BOARD "up arrow"?? nsharath Shell Programming and Scripting 1 01-27-2009 09:23 AM
SunOS 5.10 - VI Arrow keys not working ravashingravi UNIX for Dummies Questions & Answers 7 12-01-2008 10:22 AM
command scrolling using arrow keys hemangi13 UNIX and Linux Applications 4 09-11-2008 12:53 PM
Using arrow keys cooldude Solaris 4 06-13-2008 11:51 AM
How to read arrow keys on really old bash? simonb Shell Programming and Scripting 1 05-01-2006 10:27 AM
how do I get my arrow keys to work for looking thru my PREVIOUS UNIX COMMANDS spotnis UNIX for Dummies Questions & Answers 11 09-14-2005 01:22 AM
arrow keys / special keys raguramtgr UNIX for Dummies Questions & Answers 3 02-20-2004 01:45 AM
Trapping Arrow keys nageshrc Shell Programming and Scripting 1 11-30-2001 02:36 PM