Fw: redirect system command STDER

Fw: redirect system command STDER

am 20.07.2011 14:38:02 von Shlomi Fish

--MP_/EJc=o=nssaHEUpCE=GFS72g
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Hi,

we keep receiving these messages when posting to beginners@perl.org. Can you
please unsubscribe lellis@claimspages.com from it?

Regards,

-- Shlomi Fish

--=20
------------------------------------------------------------ -----
Shlomi Fish http://www.shlomifish.org/
My Aphorisms - http://www.shlomifish.org/humour.html

Chuck Norris can make the statement â€=9CThis statement is false.â€=
=9D a true one.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--MP_/EJc=o=nssaHEUpCE=GFS72g
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit

Return-path:
X-Spam-Checker-Version: SpamAssassin 3.4.0-r929098 (2010-03-30) on
telaviv1.shlomifish.org
X-Spam-Level:
X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DKIM_ADSP_NXDOMAIN,
FROM_MISSP_DKIM,MIME_QP_LONG_LINE,NO_DNS_FOR_FROM,SPF_HELO_P ASS autolearn=no
version=3.4.0-r929098
Envelope-to: shlomif@shlomifish.org
Delivery-date: Wed, 20 Jul 2011 05:25:26 -0500
Received: from mail.claimspages.com ([75.112.143.133]:54214)
by gator245.hostgator.com with esmtp (Exim 4.69)
(envelope-from )
id 1QjTy2-0005c4-Mg
for shlomif@shlomifish.org; Wed, 20 Jul 2011 05:25:26 -0500
Received: from del-rightfax ([10.0.1.27]) by mail.claimspages.com with Microsoft SMTPSVC(5.0.2195.7381);
Wed, 20 Jul 2011 05:43:51 -0400
MIME-Version: 1.0
X-Mailer: RightFax SMTP/POP3 E-mail Gateway
Sender: RightFax E-mail Gateway
From: RightFax E-mail Gateway
Subject: Re: Re: redirect system command STDER
To: shlomif@shlomifish.org
Date: Wed, 20 Jul 2011 05:43:51 -0400
Content-Type: multipart/mixed; boundary="=PMail:=_0046@@ZLb0nazbXani7b2LKS0r"
Message-ID:
X-OriginalArrivalTime: 20 Jul 2011 09:43:51.0890 (UTC) FILETIME=[8874F320:01CC46C1]


--=PMail:=_0046@@ZLb0nazbXani7b2LKS0r
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Valid fax destination information could not be found in your=
mail message. The message was discarded. Examples of pro=
perly formatted messages: /name=3Dfrank/fax=3D3217453@faxgat=
e.company.com Frank Smith /name=3Dfrank/fax=3D3217453/ e@company.com> The original message information follows: =
Received: from mx.npci.net ([10.0.1.60]) by mail.claimspage=
s.com with Microsoft SMTPSVC(5.0.2195.7381); =09 Wed, 20 Jul =
2011 05:43:48 -0400 Received: from localhost (unknown [127.0=
..0.1]) =09by mx.npci.net (Postfix) with ESMTP id 9D8A22E463E =
=09for ; Wed, 20 Jul 2011 09:43:48 +000=
0 (UTC) X-Virus-Scanned: amavisd-new at nationwide.net, cpde=
v20.com, claimspages.com Received: from mx.npci.net ([127.0.=
0.1]) =09by localhost (del-mx1.nationwide.net [127.0.0.1]) (am=
avisd-new, port 10024) =09with ESMTP id xErkade46R6G for lis@claimspages.com>; =09Wed, 20 Jul 2011 05:43:43 -0400 (EDT)=
Received: from x6.develooper.com (x6.develooper.com [207.17=
1.7.86]) =09by mx.npci.net (Postfix) with ESMTP id 51DD42E4561=
=09for ; Wed, 20 Jul 2011 05:43:43 -0=
400 (EDT) Received: from lists-nntp.develooper.com (localhos=
t.localdomain [127.0.0.1]) =09by x6.develooper.com (Postfix) w=
ith SMTP id 1E86017ADD =09for ; Wed, 2=
0 Jul 2011 02:43:38 -0700 (PDT) Received: (qmail 5952 invoke=
d by uid 514); 20 Jul 2011 09:43:14 -0000 Mailing-List: cont=
act beginners-help@perl.org; run by ezmlm Precedence: bulk =
List-Post: List-Help: ginners-help@perl.org> List-Unsubscribe: nsubscribe@perl.org> List-Subscribe: ribe@perl.org> List-Id: Delivered-To: =
mailing list beginners@perl.org Received: (qmail 5937 invoke=
d from network); 20 Jul 2011 09:43:14 -0000 Received: from x=
1.develooper.com (207.171.7.70) by x6.develooper.com with =
SMTP; 20 Jul 2011 09:43:14 -0000 Received: (qmail 24229 invo=
ked by uid 225); 20 Jul 2011 09:43:13 -0000 Delivered-To: be=
ginners@perl.org Received: (qmail 24225 invoked by alias); 2=
0 Jul 2011 09:43:13 -0000 X-Spam-Check-By: la.mx.develooper.=
com Received: from gateway16.websitewelcome.com (HELO gatewa=
y16.websitewelcome.com) (69.56.162.7) by la.mx.develoo=
per.com (qpsmtpd/0.28) with SMTP; Wed, 20 Jul 2011 02:43:07 =
-0700 Received: (qmail 22012 invoked from network); 20 Jul 2=
011 09:41:24 -0000 Received: from gator245.hostgator.com (74=
..53.88.50) by gateway16.websitewelcome.com with SMTP; 20 J=
ul 2011 09:41:24 -0000 Received: from [79.183.124.234] (port=
=3D50803 helo=3Dtelaviv1.shlomifish.org) =09by gator245.hostgator.=
com with esmtpa (Exim 4.69) =09(envelope-from ish.org>) =09id 1QjTIy-00018D-Rf; Wed, 20 Jul 2011 04:43:01 -0=
500 Received: from telaviv1.shlomifish.org (telaviv1.shlomif=
ish.org [127.0.0.1]) =09by telaviv1.shlomifish.org (Postfix) w=
ith ESMTP id D202911BD47; =09Wed, 20 Jul 2011 12:42:45 +0300 (=
IDT) Date: Wed, 20 Jul 2011 12:42:45 +0300 From: Shlomi Fis=
h To: Jim Gibson com> Cc: Subject: Re: redirect system =
command STDER Message-ID: <20110720124245.0192b2a6@telaviv1.=
shlomifish.org> In-Reply-To: l.com> References: 9m8fkhsa=3DFA@mail.gmail.com > =09 ail.com> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.5; i586-magei=
a-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; ch=
arset=3DUTF-8 Content-Transfer-Encoding: quoted-printable X-A=
ntiAbuse: This header was added to track abuse, please includ=
e it with any abuse report X-AntiAbuse: Primary Hostname - =
gator245.hostgator.com X-AntiAbuse: Original Domain - perl.o=
rg X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12=
] X-AntiAbuse: Sender Address Domain - shlomifish.org X-BWh=
itelist: no X-Source: X-Source-Args: X-Source-Dir: X-S=
ource-Sender: bzq-79-183-124-234.red.bezeqint.net (telaviv1.s=
hlomifish.org) [79.183.124.234]:50803 X-Source-Aut h: shlomi=
f@shlomifish.org X-Email-Count: 1 X-Source-Cap: c2hsb21pZjt=
zaGxvbWlmO2dhdG9yMjQ1Lmhvc3RnYXRvci5jb20= =0AReturn-Path : begin=
ners-return-117960-lellis=3Dclaimspages.com@perl.org X- Origina=
lArrivalTime: 20 Jul 2011 09:43:48.0749 (UTC) FILETIME=3D[8695A=
BD0:01CC4 6C1] Hi Jim, On Tue, 19 Jul 2011 16:22:14 -0=
700 Jim Gibson wrote: > On 7/19/11=
Tue Jul 19, 2011 12:14 PM, "Tessio Fechine" ..com> > scribbled: > > > Hello, > > I have a subroutine =
that uses useradd to create accounts > > > > -- > > @cmd =
=3D ('useradd', '-m', $account); > > my $result =3D system @cmd;=
> > -- > > > > but when useradd fails, I need to stop it=
from sending the error message to > > STDER. > > Is it po=
ssible with system? > > You can use a shell process to dis=
card STDERR messages (untested): > > my $cmd =3D "useradd -m=
$account 2> /dev/null"; > my $result =3D system($cmd); > =0D=
=0AThe problem with interpolating strings into shell commands l=
ike that is that someone may put malicious code in it: =09=
my $account =3D 'foo; rm -fr / '; so be careful - see: http:=
//shlomif-tech.livejournal.com/35301.html (Code/Markup Injec=
tion and Its Prevention ). Regards, =09Shlomi Fish > Y=
ou could do the same by writing a shell script to redirect ST=
DERR and call > that from your Perl program. > > You can=
also use the IPC::Open3 module to capture STDERR. See 'perld=
oc > IPC::Open3' for examples. > > > > -- -=
------------------------------------------------------------ -=
--- Shlomi Fish http://www.shlomifish.org/ Apple Inc.=
is Evil - http://www.shlomifish.org/open-source/anti/apple/=0D=
=0AAn apple a day keeps the doctor away. Two apples a day wi=
ll keep two doctors away. â€=94 one of Shlomi Fishâ€=99s re=
latives Please reply to list if it's a mailing list post -=
http://shlom.in/reply . -- To unsubscribe, e-mail: begi=
nners-unsubscribe@perl.org For additional commands, e-mail: =
beginners-help@perl.org http://learn.perl.org/ =0D =0A
--=PMail:=_0046@@ZLb0nazbXani7b2LKS0r--


--MP_/EJc=o=nssaHEUpCE=GFS72g
Content-Type: text/plain; charset=us-ascii

--
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
http://learn.perl.org/

--MP_/EJc=o=nssaHEUpCE=GFS72g--