Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ssh2 command backspace 1

Status
Not open for further replies.

anorakgirl

Programmer
Jun 5, 2001
103
GB
hi,
i'm writing some scripts to allow users to run simple tasks on our server. the user runs the script by running this command on their pc:
Code:
ssh2 -t user@myserver.com test.sh
the file test.sh then requires some user input e.g.
Code:
echo Please type something
read SOMETHING
which works fine except the backspace key doesn't work, it prints ^H. However, backspace does work when the user ssh's into the box without specifying the command to run (i.e.
Code:
ssh2 user@myserver.com
).

any idea how i can set the backspace to work properly when i execute a script like this?

thanks! ~ ~
 
hmm, i tried
Code:
ssh2 -t user@myserver.com env
and
Code:
ssh2 user@myserver.com 
env
in both cases the TERM variable is vt100. but in the second case i can't delete. none of the other environment variables look like they're relevant to this. i was wondering if its a setting in one of the scripts that gets executed when you log on normally, but not when you just issue a command?
~ ~
 
It really depends on what shell language you are using ofr your scripts. Try changing your scripts to another language like bash, or even tcsh.

You may even be able to set the backspace character in your script.

Try placing this line near the top of your script:

stty erase
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top