Hi,
I have the following line in my script:
system ( "export A=10; myScript.pl param1 par^AAA^da " );
When I run it in Unix I get the following error:
sh: can execute AAA
In some shells, the ^ character means the same thing as the | character --
pipe the output of one command into the input of another. So your shell
appears to be trying to run the commands "myscript.pl param1 par", "AAA", and
"da".
I can think of two ways to fix this:
1) (more Perl-ish)
$ENV{A}=10;
system 'myScript.pl', 'param1', 'par^AAA^da';
This allows this Perl script to call myScript.pl directly, without
requiring a shell to parse the command line, so the characters that
are special to the shell don't get processed.
(It does set the environment variable A for the rest of this script's
run; there are workarounds if that's a potential issue.)
2) (minimal changes to this script)
system ( "export A=10; myScript.pl param1 'par^AAA^da' " );
The single quotes in this string will be included in the command
passed to the shell, and will prevent the shell from processing special
characters inside the quotes when it parses the arguments for myScript.pl.
Please advice what is ^*^
That looks like it might be a rather impolite emoticon.
Gary Ansok