Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
> TCL escape characters, don't know how to use the backslash escape
post Oct 20 2008, 01:22 PM
Post #1

Whats this Lie-nix Thing?

Group: Members
Posts: 3
Joined: 15-September 08
Member No.: 13,666

Folks, I'm having a problem with a tcl escape character: the backslash.

I'm trying to create a script that calls another script. One of the parameters that is sent to the other script is a password (to use with ssh). Well, if the password is a usual string, like 'carrie', it works fine. The problem occurs when the first letter of the password is a dollar sign, like $testpass. When this password is used, tcl seems to write the string inside braces, like {$testpass}. This new value created by tcl is sent to the second script, and then my system fails, because the correct password is $testpass, and not {$testpass}.

Please, somebody that knows tcl can help me?

A simple teste code shows my problem:


package require Expect

set timeout 15

set ssh_password \$testpass

spawn ./ 5622 root $ssh_password md5sum /root/ipt-firewall


Debugging, I found that the parameters given to spawn by tcl engine was:

./ 5622 root {$testpass} md5sum /root/ipt-firewall

Where the incorrect password appears... It should be $testpass.

Thanks by the attention dudes...
Go to the top of the page
+Quote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 24th October 2017 - 06:28 AM