[Israel.pm] system() platform dependant issue

Levenglick Dov-RM07994 dovl at freescale.com
Tue Sep 5 04:22:54 PDT 2006

I tried modifying $ENV{SHELL}, but it didn't help. Doesn't Perl call the
shell specified in %ENV? 

Best Regards,
Dov Levenglick
DSP SoC System and Applications Engineer,
Network and Computing Systems Group
Freescale Semiconductor Israel
Tel. +972-9-952-2804
The information contained in this email is classified as:
[x] Freescale General Business Information
[ ] Freescale Internal Use Only
[ ] Freescale Confidential Proprietary
[ ] Personal Memorandum

-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On
Behalf Of Omer Zak
Sent: Tuesday, September 05, 2006 14:16
To: Perl in Israel
Subject: Re: [Israel.pm] system() platform dependant issue

The reason is that under Solaris, your perl system() invokes the system
shell (/usr/bin/sh) and gets it to execute the command.
sh does not recognize the >& construct (I confirmed this by running sh
interactively and typing the command to it).

Apparently, in Linux perl uses a more modern shell to execute the
                                              --- Omer

On Tue, 5 Sep 2006, Levenglick Dov-RM07994 wrote:

> Hi,
> This runs very nicely on Linux but returns "sh: /dev/null: bad number"
> on Solaris. Can anyone explain?
> Can anyone give me a robust solution that will run on all shells on
> platforms?
> #!/usr/local/bin/perl
> $cmd = 'echo blaaaa >& /dev/null';
> system("$cmd");

My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html

Perl mailing list
Perl at perl.org.il

More information about the Perl mailing list