For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > March 2006 > perl -c someScript >someFile









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author perl -c someScript >someFile
Tom Arnall

2006-03-23, 6:58 pm

i want to capture to a file the output of perl's '-c' command-line option, as
in:

perl -c someScript >someFile

perl insists on simply dumping the output to the screen. is there a solution
to this?

thanks,

tom arnall
north spit, ca


Timothy Johnson

2006-03-23, 6:58 pm

It looks like it's using STDERR for output. Try this:

perl -c someScript >somefile 2>&1



-----Original Message-----
From: tom arnall [mailto:kloro@cox.net]=20
Sent: Thursday, March 23, 2006 12:04 PM
To: beginners@perl.org
Subject: perl -c someScript >someFile

i want to capture to a file the output of perl's '-c' command-line
option, as=20
in:

perl -c someScript >someFile
=09
perl insists on simply dumping the output to the screen. is there a
solution=20
to this?

thanks,

tom arnall
north spit, ca



--=20
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Mr. Shawn H. Corey

2006-03-23, 6:58 pm

Timothy Johnson wrote:
> It looks like it's using STDERR for output. Try this:
>
> perl -c someScript >somefile 2>&1


You can send it there directly:

perl -c someScript 2>somefile

--

Just my 0.00000002 million dollars worth,
--- Shawn

"For the things we have to learn before we can do them,
we learn by doing them."
Aristotle

"The man who sets out to carry a cat by its tail learns something that
will always be useful and which will never grow dim or doubtful."
Mark Twain

"Believe in the Divine, but paddle away from the rocks."
Hindu Proverb

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/

Balan Ranganathan

2006-03-24, 3:59 am


Use

perl -c someScript | tee file

Thanks

Best regards
Bala

-----Original Message-----
From: tom arnall [mailto:kloro@cox.net]=0D
Sent: Friday, March 24, 2006 1:34 AM
To: beginners@perl.org
Subject: perl -c someScript >someFile

i want to capture to a file the output of perl's '-c' command-line
option, as=0D
in:

perl -c someScript >someFile
=0D
perl insists on simply dumping the output to the screen. is there a
solution=0D
to this?

thanks,

tom arnall
north spit, ca



--=0D
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org
<http://learn.perl.org/> <http://learn.perl.org/first-response>




The information contained in this electronic message and any attachments to=
this message are intended for the exclusive use of the addressee(s) and=
may contain proprietary, confidential or privileged information. If you=
are not the intended recipient, you should not disseminate, distribute or=
copy this e-mail. Please notify the sender immediately and destroy all=
copies of this message and any attachments.=0D

WARNING: Computer viruses can be transmitted via email. The recipient=
should check this email and any attachments for the presence of viruses.=
The company accepts no liability for any damage caused by any virus=
transmitted by this email.
=0D
www.wipro.com
Mr. Shawn H. Corey

2006-03-24, 7:57 am

balan.ranganathan@wipro.com wrote:
> Use
>
> perl -c someScript | tee file


perl -c someScript 2>&1 | tee somefile

tee(1) only works with stdout, perl -c sends its output to stderr.


--

Just my 0.00000002 million dollars worth,
--- Shawn

"For the things we have to learn before we can do them,
we learn by doing them."
Aristotle

"The man who sets out to carry a cat by its tail learns something that
will always be useful and which will never grow dim or doubtful."
Mark Twain

"Believe in the Divine, but paddle away from the rocks."
Hindu Proverb

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is at http://perldoc.perl.org/

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com