You're viewing a comment by Jagadish and its responses.

Jagadish Permalink
March 27, 2013, 10:24

I am writing a console mode shell scipt.I am trying to read a char in my shell script

echo "Enter the word"
read ch
echo $ch

[Unix@myunix ~]$ ./
Enter the word
Hello wonld^[[D^[[D

Issue: Here u see i miss spelled Hello world as Hello wonld.

I am trying to use left arrow keys to go back to the characted 'n' and change it to 'r'. Here the left arrow keys are pressed 2 times. It is displaying ^[[D instead of going back one character.

Can you pls let me know what changes i need to make to work as i expect.

I am using "GNU bash, version 4.2.39(1)-release"

Thanks and Regards,

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "rocket_42": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.