Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Shell TCL替代_Shell_Tcl - Fatal编程技术网

Shell TCL替代

Shell TCL替代,shell,tcl,Shell,Tcl,我必须运行一个脚本,其中我必须给出一些密码作为参数。密码包含特殊字符 假设我使用test.tcl system$123调用一个脚本 尝试使用访问arg时出错 set name [lindex $argv 0] 这些特殊字符被忽略 请帮我做这个 谢谢, Ramya.Tcl不会忽略特殊字符。tcl字符串基本上没有不能包含的内容 然而,shell可能会对特殊字符进行不同的解释。试着这样称呼它: test.tcl 'system$123' 请记住,像tcl这样的大多数shell都实现了$substi

我必须运行一个脚本,其中我必须给出一些密码作为参数。密码包含特殊字符

假设我使用test.tcl system$123调用一个脚本

尝试使用访问arg时出错

set name [lindex $argv 0]
这些特殊字符被忽略

请帮我做这个

谢谢,
Ramya.

Tcl不会忽略特殊字符。tcl字符串基本上没有不能包含的内容

然而,shell可能会对特殊字符进行不同的解释。试着这样称呼它:

test.tcl 'system$123'

请记住,像tcl这样的大多数shell都实现了$substitution。

请确保您的shell没有将$123插入到空白字符串中。放入$argv以查看您实际处理的是什么。如果没有问题,请多发布一些代码,特别是您的起始行。另一种方法是test.tcl system\$123,但这只是防止系统外壳引用的另一种方法。