Fw: redirect system command STDER

--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 [at] perl.org. Can you
please unsubscribe lellis [at] claimspages.com from it?

Regards,

-- Shlomi Fish

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

Chuck Norris can make the statement =E2=80=9CThis statement is false.=E2=80=
=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: <lellis [at] del-exchange1.nationwide.net>
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 [at] 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 <lellis [at] del-exchange1.nationwide.net>)
id 1QjTy2-0005c4-Mg
for shlomif [at] 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<lellis [at] del-exchange1.nationwide.net>
From: RightFax E-mail Gateway<lellis [at] del-exchange1.nationwide.net>
Subject: Re: Re: redirect system command STDER
To: shlomif [at] shlomifish.org
Date: Wed, 20 Jul 2011 05:43:51 -0400
Content-Type: multipart/mixed; boundary="=PMail:=_0046 [at] [at] ZLb0nazbXani7b2LKS0r"
Message-ID: <DEL-EXCHANGE1L947FR00001bb2 [at] mail.claimspages.com>
X-OriginalArrivalTime: 20 Jul 2011 09:43:51.0890 (UTC) FILETIME=[8874F320:01CC46C1]


--=PMail:=_0046 [at] [at] ZLb0nazbXani7b2LKS0r
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

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


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

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

--MP_/EJc=o=nssaHEUpCE=GFS72g--
Shlomi Fish [ Mi, 20 Juli 2011 14:38 ] [ ID #2062290 ]
Perl » gmane.comp.lang.perl.beginners » Fw: redirect system command STDER

Vorheriges Thema: Regular Expression change
Nächstes Thema: grep question