[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: how do I do this is shell script?



on Wed, Jun 11, 2003 at 05:15:32PM -0400, Chun Kit Edwin Lau (try_email_me@yahoo.ca) wrote:
> Hi everyone,
> 
> 	I am writing some shell script (bash) to read from Addresses.pdb
> and convert it to mutt address using lbdbq.  I encounter a problem where
> some ppl have two or even 3 emails which I have to come out with a
> unique alias in mutt.  How do I put a number in the alias name
> automatically to make it unique.  So far I have
> 
> MUTT_ADDRESSES=~/.mutt/mutt.addresses
> ADDRESSES_PDB=~/AddressDB.pdb
> 
> lbdbq | sed '1 d' |
> sed 's/^\([A-Za-z0-9_-.]*@[A-Za-z0-9_-.]*\)\t\([A-Za-z0-9_-.]*\)[ ]*\([A-Za-z0-9_-. ]*\)\t(Palm)/alias \2 "\2 \3" <\1>/' |
> sort > $MUTT_ADDRESSES
       ^
       -u

Peace.

-- 
Karsten M. Self <kmself@ix.netcom.com>        http://kmself.home.netcom.com/
 What Part of "Gestalt" don't you understand?
    "Life," said Marvin dolefully, "loathe it or ignore it, you can't
    like it."
    -- HHGTG

Attachment: pgpu7NTAqkqRV.pgp
Description: PGP signature


Reply to: