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

Re: perl equivalent

Thread Previous
John W. Krahn
April 2, 2002 17:51
Re: perl equivalent
Message ID:
Pankaj Anand wrote:
> Hi ,


> 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?

use Perl;

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About