ramya
ramya

Reputation: 928

TCL substitution

I have to run a script where I have to give some password as the argument. The password contains special characters.

Say I am calling a script with test.tcl system$123.

On trying to access the arg with

set name [lindex $argv 0]

These special characters are ignored.

Please help me on this.

Thanks, Ramya.

Upvotes: 0

Views: 137

Answers (1)

slebetman
slebetman

Reputation: 113866

Tcl doesn't ignore the special characters. There's basically nothing that a tcl string can't contain.

The shell however may interpret the special character differently. Try calling it this way:

test.tcl 'system$123'

Remember that most shells, like tcl, implements $ substitution.

Upvotes: 8

Related Questions