【发布时间】:2013-07-28 22:04:34
【问题描述】:
我正在尝试使用 php 脚本中的参数调用 perl 脚本。 perl 脚本采用的参数包含一个分号。
eg : perlfile <string;continuedstring>
如果我使用system("perfile <string;continuedstring>
Unix 以不同方式解释 ; 并显示错误。
有没有办法让我逃脱 ; 以便 unix 将其解释为参数。
【问题讨论】:
我正在尝试使用 php 脚本中的参数调用 perl 脚本。 perl 脚本采用的参数包含一个分号。
eg : perlfile <string;continuedstring>
如果我使用system("perfile <string;continuedstring>
Unix 以不同方式解释 ; 并显示错误。
有没有办法让我逃脱 ; 以便 unix 将其解释为参数。
【问题讨论】:
我认为system 采用了 bourne shell 命令,在这种情况下,您可以选择该命令
perlfile '<string;continuedstring>'
或
perlfile \<string\;continuedstring\>
你会调用system as
system("perlfile '<string;continuedstring>'");
或
system("perlfile \\<string\\;continuedstring\\>");
分别。
【讨论】:
您是否尝试过使用反斜杠作为转义字符?
【讨论】: