how to suppress exp_spawn translating first " to \ ?

Posted by danaf on 2013-11-01 01:36
Forums: Expect discussion | OS: Windows 7

I am using tcl8.5 on windows 7. I need to use spawn with openssh. The username has double-quotes (e.g. abc"). I can use openssh to login the remote device with this account when I am using it in a command window:

D:\Program Files\OpenSSH\bin>ssh -labc"\""
abc"@'s password:

(the correct user name is displayed by openssh)

However, when I use spawn ssh with the same syntax in a script, the " is translated to \
When I enter the correct password, access is denied.

exp_spawn "$sshClient" "" -labc\"\\\"\"

The following attempt also shows " being translated to \
exp_spawn "$sshClient" "" -labc\"

Could anyone show me the correct syntax please? Or is there any option in exp_spawn I need to enable?