RE: Perl one liner....

2006-05-24 Thread Nagasamudram, Prasanna Kumar
Thanks Shawn...that worked... I think it was everything to do with double quotes on windows. -Original Message- From: Mr. Shawn H. Corey [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 23, 2006 11:50 PM To: beginners@perl.org Subject: Re: Perl one liner On Tue, 2006-23-05 at 11:36

Re: Perl one liner....

2006-05-23 Thread M Senthil Kumar
On Tue, 23 May 2006, Nagasamudram, Prasanna Kumar wrote: |I'm trying to do a find and replace on the file content using the |following command on windows. [snipped] |perl -p -i.bak -e 's/FOO/BAR/g' abc.txt [snipped] Hi, Try: $ perl -pi.bak -e 's/FOO/BAR/' abc.txt Note: abc.txt has BAR,

Re: Perl one liner....

2006-05-23 Thread Mr. Shawn H. Corey
On Tue, 2006-23-05 at 11:36 -0700, M Senthil Kumar wrote: On Tue, 23 May 2006, Nagasamudram, Prasanna Kumar wrote: |I'm trying to do a find and replace on the file content using the |following command on windows. [snipped] |perl -p -i.bak -e 's/FOO/BAR/g' abc.txt [snipped] Hi,

Re: Perl one-liner to print columns

2005-04-25 Thread Jay Savage
On 4/25/05, Larsen, Errin M HMMA/IT [EMAIL PROTECTED] wrote: Hi Perlers, I typically will type the following to collect a specific column of data from some command's output: # some_command | awk '{print $4}' I wanted to start using perl one-liners more often, so I thought I'd try

Re: Perl one-liner to print columns

2005-04-25 Thread Jay Savage
On 4/25/05, Jay Savage [EMAIL PROTECTED] wrote: On 4/25/05, Larsen, Errin M HMMA/IT [EMAIL PROTECTED] wrote: Hi Perlers, I typically will type the following to collect a specific column of data from some command's output: # some_command | awk '{print $4}' I wanted to start

Re: Perl One-liner de-compile?

2005-04-25 Thread Paul Johnson
On Mon, Apr 25, 2005 at 01:45:15PM -0500, Larsen, Errin M HMMA/IT wrote: Hi everyone, Here is an example from the perlrun perldoc page: perl -ane 'print pop(@F), \n;' is equivalent to while() { @F = split(' '); print pop(@F), \n; } My

RE: Perl One-liner de-compile?

2005-04-25 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Paul Johnson [mailto:[EMAIL PROTECTED] Sent: Monday, April 25, 2005 1:53 PM To: Larsen, Errin M HMMA/IT Cc: beginners@perl.org Subject: Re: Perl One-liner de-compile? On Mon, Apr 25, 2005 at 01:45:15PM -0500, Larsen, Errin M HMMA/IT wrote: Hi

RE: Perl One-liner de-compile?

2005-04-25 Thread Charles K. Clarkson
Larsen, Errin M HMMA/IT mailto:[EMAIL PROTECTED] wrote: : Or is the @f array a secret array I'm not cleared to know about? We could tell 'ya, but then we'd have to kill 'ya. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: Perl One-liner de-compile?

2005-04-25 Thread Jeff 'japhy' Pinyan
On Apr 25, Larsen, Errin M HMMA/IT said: $ perl -MO=Deparse -ane 'print pop(@F), \n;' Note the @F, it's capital-F. # perl -MO=Deparse -nae 'print $f[4]' /some/directory/somefile You're using a lowercase @f here. LINE: while (defined($_ = ARGV)) { our(@F) = split( , $_, 0); print $f[4];

RE: Perl One-liner de-compile?

2005-04-25 Thread Larsen, Errin M HMMA/IT
-Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] Sent: Monday, April 25, 2005 2:42 PM To: Larsen, Errin M HMMA/IT Cc: beginners@perl.org Subject: RE: Perl One-liner de-compile? SNIP You're using a lowercase @f here. SNIP Perl will magically

Re: Perl One-liner de-compile?

2005-04-25 Thread John W. Krahn
Larsen, Errin M HMMA/IT wrote: Ok ... So I tried this: # perl -MO=Deparse -nae 'print $f[4]' /some/directory/somefile ^ LINE: while (defined($_ = ARGV)) { our(@F) = split( , $_, 0); print $f[4]; ^ } -e syntax OK

Re: perl one-liner for find-exec-rm

2002-05-28 Thread Gary Stainburn
On Tuesday 28 May 2002 9:42 am, Gary Stainburn wrote: Hi all, Can anyone give me the one-liner to replace find . -type f -exec rm {} \; with find . -type f |perl -? to improve the speed when deleting a large squid cache sorry, I forgot to include how far I've got. Where's

Re: perl one-liner for find-exec-rm

2002-05-28 Thread Felix Geerinckx
on Tue, 28 May 2002 08:42:03 GMT, [EMAIL PROTECTED] (Gary Stainburn) wrote: Hi all, Can anyone give me the one-liner to replace find . -type f -exec rm {} \; with find . -type f |perl -? to improve the speed when deleting a large squid cache perldoc find2perl

Re: perl one-liner for find-exec-rm

2002-05-28 Thread Gary Stainburn
On Tuesday 28 May 2002 10:00 am, Felix Geerinckx wrote: on Tue, 28 May 2002 08:42:03 GMT, [EMAIL PROTECTED] (Gary Stainburn) wrote: Hi all, Can anyone give me the one-liner to replace find . -type f -exec rm {} \; with find . -type f |perl -? to improve the

Re: perl one-liner for find-exec-rm - SOLVED

2002-05-28 Thread Sudarsan Raghavan
Gary Stainburn wrote: Hi all, I added a chomp giving - find . -type f|perl -ne 'chomp ; unlink||die $_ : $!\n' You could avoid the pipes and try this instead perl -MFile::Find -e 'find (sub {unlink|| die $File::Find::name : $!\n if (-f)}, .)' and it worked. Gary On Tuesday 28 May

Re: PERL one-liner not working within a shell script

2001-11-14 Thread Peter Scott
At 04:58 PM 11/14/01 -0500, Thomas Lewis wrote: Hello all. I have a weird problem. When I run this PERL one-liner by hand it prints everything within the appropriate range... perl -ne 'print if /NTHOST\) Total/ .. /ANR0403I/' /tmp/TIVOLI.OUT-activity-report This prints up the summary of a

Re: Perl one-liner problem

2001-09-08 Thread Me
[on list] On Apache Unix, this just hangs and does nothing and I have to do control d to kill it! perl -wpi.org -e s@/cgi-bin/forum_idx.pl@/fakecgi/fakeforum_idx.pl@ It doesn't hang, it's waiting for input. Other notes: 1. A backup file given .org as its extension? Weird. Most people use

Re: Perl one-liner problem

2001-09-07 Thread Me
Any idea why this aint working? perl -wpi.org -e s@/cgi-bin/forum_idx.pl@/fakecgi/fakeforum_idx.pl@ no quotes around the string to be evaluated (the s@...@...@ bit). -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]