Reputation: 2433
I am trying to call perl script with a parameter from a php script. The argument that a perl script takes contains a semicolon.
eg : perlfile <string;continuedstring>
If I use system("perfile <string;continuedstring>
Unix interprets ;
differently and shows an error.
Is there a way that I can escape ;
so that unix interprets it as an argument.
Upvotes: 1
Views: 141
Reputation: 386501
I presume system
takes a bourne shell command, in which case the command would your choice of
perlfile '<string;continuedstring>'
or
perlfile \<string\;continuedstring\>
You would invoke system
as
system("perlfile '<string;continuedstring>'");
or
system("perlfile \\<string\\;continuedstring\\>");
respectively.
Upvotes: 1