develooper Front page | perl.beginners | Postings from April 2002

Re: perl equivalent

Thread Previous
From:
John W. Krahn
Date:
April 2, 2002 17:51
Subject:
Re: perl equivalent
Message ID:
3CAA5FBD.F58595BB@acm.org
Pankaj Anand wrote:
> 
> Hi ,

Hello,

> I need a small help .
> I have one script with these commands.But I think perl can do it
> efficiently.
> 
> What will be the perl equivalent for this -
> grep UNBIND $file|tr "=" " "|awk '{print $4}' > /tmp/con
> for i in `cat /tmp/con`
> do
> ip=`grep $i $file |grep from |awk '{print $8}'`
> op=`grep $i $file |grep UNBIND |tr "=" " "|awk '{print $6}'`
> echo "$ip       $op" >> /tmp/ipop

It would help a lot if you could show what the contents of $file are and
what you expect the results to look like.  In the last line you are
appending to /tmp/ipop, is that the final destination for your data or
are putting it there for another program?



John
-- 
use Perl;
program
fulfillment

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About