Problem in /bin/bash with stty erase


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem in /bin/bash with stty erase
# 1  
Old 07-16-2009
Problem in /bin/bash with stty erase

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 :

Code:
#!/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 Neo; 07-16-2009 at 07:28 AM.. Reason: code tags
# 2  
Old 07-16-2009
read the rules please. particularly:
Quote:
(11) Post questions with descriptive subjects. For example, do not post questions with subjects like "Help Me!", "Urgent!!" or "Doubt". Post subjects like "Execution Problems with Cron" or "Help with Backup Shell Script".
# 3  
Old 07-16-2009
sry about this, it was a mistake.
I wanted to add something to my previous post and something went wrong and this post appeared!!
and now i don't know how to discard this post....
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed

In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed ? Is there any way to get the script names for the process command ? --- Post updated at 08:39 AM --- in KSH (Korn Shell), my command output shows the script names but when run in the Bash Shell... (3 Replies)
Discussion started by: i4ismail
3 Replies

2. Shell Programming and Scripting

Usage of #!/bin/sh vs #!/bin/bash shell scripts?

Some question about the usage of shell scripts: 1.) Are the commands of the base shell scripts a subset of bash commands? 2.) Assume I got a long, long script WITHOUT the first line. How can I find out if the script was originally designed für "sh" or "bash"? 3.) How can I check a given... (3 Replies)
Discussion started by: pstein
3 Replies

3. Shell Programming and Scripting

BIN/BASH.

THANKS UNIX SYSTEM®.I was found my job from UNIX®.I USE MONKEY WRENCH WITH WARTER.I am now studying my studio with UNIX SYSTEM®. THANKS UNIX SYSTEM®. THANKS OUR OPEN GROUP. from Takayasu Sakashita.My name is Takayasu Sakashita. I respect you. Austin.PEACE!Bey bey. Your friend TAKA.Good... (1 Reply)
Discussion started by: administrator®
1 Replies

4. Shell Programming and Scripting

stty erase ^h not working for backspace

Hi , I have to press shift + Backspace to do backspace on my unix termminal everytime. How can i configure it to a normal backspace only. Please help me here. PFB the contents of the stty -a : dbtgr@hpxi017:/pocuser/C5/aimsys/dbtgr> stty -a speed 38400 baud; line = 0; rows = 35; columns =... (4 Replies)
Discussion started by: kunwar
4 Replies

5. Shell Programming and Scripting

/bin/bash - variable substitution.

Is it possible with a bash variable to perform multiple substitution strings to one variable? I have this variable: echo $clock TIMEZONE="US/Central" What I would like to do with bash only it pull out just the "US" part of the variable.. which could be any number of countries. this is... (6 Replies)
Discussion started by: trey85stang
6 Replies

6. Shell Programming and Scripting

/bin/sh and /bin/ksh problem

we have a shell script that we are using in KSH if ]; then _IFS=$IFS IFS=: and it's failing on /bin/sh . Is there a simple way to modify it to work on both . ( not with awk) Thanks in adv (3 Replies)
Discussion started by: talashil
3 Replies

7. Solaris

stty erase on solaris 8 sparc

Hi All, I put all these combination either: stty erase ^H or stty erase "^H" on /etc/profile or /home/user/.profile. But backspace erase won't work on my keyboard. I'm using putty on my remote connection with ultra 10. On the console or direct connection with sun keyboard, it does. ... (3 Replies)
Discussion started by: itik
3 Replies

8. UNIX for Advanced & Expert Users

stty erase r

after hitting this command...on pressing r acts as a backspace character.... how to disable this function (5 Replies)
Discussion started by: bishweshwar
5 Replies

9. UNIX for Advanced & Expert Users

stty erase in a script

does anyone know how to incorporate this in a script so users can actually make use of their backspace button that they've grown accustomed to? stty erase ^H --- this isn't working the script. works on command line but i wanna invoke it whenever this program of mine is run so users can use... (2 Replies)
Discussion started by: Terrible
2 Replies

10. UNIX for Dummies Questions & Answers

stty erase e command

I'm not familiar with the stty command. What would "stty erase e" do to my system and what kind of problems would it create? Also, how would I undo this command? (1 Reply)
Discussion started by: CEngel0327
1 Replies
Login or Register to Ask a Question