Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > system command failed

Reply
Thread Tools

system command failed

 
 
shurikgefter@gmail.com
Guest
Posts: n/a
 
      09-09-2008
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
 
Reply With Quote
 
 
 
 
Leon Timmermans
Guest
Posts: n/a
 
      09-09-2008
On Tue, 09 Sep 2008 12:11:31 -0700, wrote:

> 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
 
Reply With Quote
 
 
 
 
J. Gleixner
Guest
Posts: n/a
 
      09-09-2008
wrote:
> 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'.
 
Reply With Quote
 
smallpond
Guest
Posts: n/a
 
      09-09-2008
On Sep 9, 3:11 pm, "shurikgef...@gmail.com" <shurikgef...@gmail.com>
wrote:
> 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
 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      09-09-2008
"" <> wrote:
>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


Well, that's great that sh is able to execute AAA. Where is the problem?

jue
 
Reply With Quote
 
Gary E. Ansok
Guest
Posts: n/a
 
      09-10-2008
In article <2de578a1-8ea3-4aad-ab5d->,
<> wrote:
>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
--
The recipe says "toss lightly," but I suppose that depends
on how much you eat and how bad the cramps get. - J. Lileks
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
suppress opening command window after using os.system command boriq Python 4 06-12-2008 10:42 AM
SQL 2005 Assembly: System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission'... failed Siberwulf ASP .Net 0 10-05-2006 11:39 PM
Errors: Failed to load viewstate. & Validation of viewstate MAC failed. sck10 ASP .Net 6 09-01-2006 05:59 PM
QueryInterface for interface Excel._Application failed / QueryInterface for interface Word._Application failed SOLUTION Wildepiet ASP .Net 0 06-14-2004 07:28 AM
os.system('cd dir1 ... and executing next os.system command in that directory (dir1) Irmen de Jong Python 2 08-12-2003 12:43 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57