system command failed

S

shurikgefter

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

Please advice what is ^*^

Thanks
 
L

Leon Timmermans

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

Please advice what is ^*^

Thanks

This is not a Perl problem but a shell problem. You should probably ask
in comp.unix.shell. Don't forget to tell them what shell you are running.

Regards,

Leon
 
J

J. Gleixner

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

How do you 'get' that error?
Please advice what is ^*^

Ahhhh.. What are you asking? Where is '^*^'?

Maybe you should look at or post 'myScript.pl'.
 
S

smallpond

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

Please advice what is ^*^

Thanks

^*^ appears to be the rarely used emoticon for a flying hedgehog.

My guess is you have a typo or editor artifact in your script.

--S
 
G

Gary E. Ansok

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top