Hello All..
Can someone tell me how to use "backspace" key in a script. I tried to use ^C (type from the keyboard) but its not working. I know its a silly question to ask but I am really frustated with this thing for good 1 hour or so.
I am trying to provide an input file to a script so that I do not need to hit "backspace" key manually.
thanks in advance guys.
When editing your script using vi, use this exact sequence:
^V^H
Where ^V is a "Control-V" and ^H is "Control-H".
Example:
echo "hello^V^H^V^H^V^Hwow"
will produce as output, when run:
hewow
Notice that the Control-V will be displayed as a simple caret (^) when typed.
You can use exactly the same technique on the command line for both ksh and bash.
-mschwage
check whether stty erase somecharanters and the character you set work