John W. Krahn wrote:
> KEVIN ZEMBOWER wrote:
>>I have a series of EZMLM configuration files  in the ~alias directory that 
>>look like this:
>>main:/var/qmail/alias# cat cire/config 
>>F:-aBCdEFGHiJKlmnOpQrStuVWXYZ
>>X:
>>D:/var/qmail/alias/cire
>>T:/var/qmail/alias/.qmail-cire
>>L:cire
>>H:infoforhealthx.org
>>C:
>>0:
>>3:
>>4:
>>5:
>>6:
>>7:
>>8:
>>9:
>>main:/var/qmail/alias# 
>>
>>I want to find them all and output the L: (list name) and H: (host name) 
>>information like this for the
>>above example:
>>[EMAIL PROTECTED]
>>
>>I've tried this unsuccessfully:
>>main:/var/qmail/alias# for x in `find -name config`; do { perl -ne 
>>"($name)=/L:(.*)$/; ($add)=/H:(.*)$/;
>>__END__ { print [EMAIL PROTECTED]; }" $x; } done
>>main:/var/qmail/alias# 
>>
>>Any suggestions on the mistakes I've made?
> 
> 
> perl -l -0777ne'print /^L:(.+)/, q/@/, /^H:(.+)/' `find -name config`

This may work a bit better:


perl -l -0777ne'$_ = join q/@/, /^L:(.+)/, /^H:(.+)/ and print' \
 `find -name config`


:-)

John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to