Subject: OFFER: scripts to convert alias-files

From: Guenter Mueller <[email-masked]>
Date: Wed, 10 Nov 1993 19:22:03 +0100 (MEZ)

Hello, 

the last few weeks we have made pine public available to our users. I have
created a few scripts to help them to convert their alias files. They are
written quick and dirty for AIX 3.2.4. The functions used in awk are
available in nawk on the sun platform. Maybe you can put them into the
distribution... 

Kind Regards

Guenter

Guenter Mueller  [email-masked]   Phone: +49 761 203 -4622
         University of Freiburg - Computing Center     FAX:             -4643
>>>>>>>>>>>>>>>>> New Phone and FAX Numbers since 10.10.93 <<<<<<<<<<<<<<<<<<
#! /bin/sh -
# converts from pine-adressbook to unix .mailrc
#
awk -F"\t" ' {
    nick=$1
    name=$2
    sub(",",";",name)
    n=index($3,",")
    addr=$3
    if(n) {
        while (substr(addr,length(addr))==","){
            FS=" "
            getline
            addr=addr $1
            FS="\t"
            }
        gsub("[()]","",addr)
        gsub("[,]"," ",addr)
        }
  print "alias  "nick" "addr
}
' $HOME/.addressbook
#! /bin/sh -
# converts from unix-aliasing to pine-adressbook
#
awk ' {
    if($1 != "alias") continue
    name=$2
    addr=$3
    if(NF > 3) {
        for (i=4;i<=NF;i++){
            addr=addr","$i
            }
        addr= "("addr")"
        }
   print name"\t\t"addr
}
' $HOME/.mailrc
#! /bin/sh -
# converts from elm-aliasing to pine-adressbook
#
awk -F"=" ' {
    name=$2
    sub(";",",",name)
    n=index($3,",")
    addr=$3
    if(n) {
        addr= "("addr")"
        }
   print $1"\t"name"\t"addr
}
' $HOME/.elm/aliases.text

#! /bin/sh -
# converts from elm-aliasing to pine-adressbook
#
awk -F"\t" ' {
    nick=$1
    name=$2
    sub(",",";",name)
    n=index($3,",")
    addr=$3
    if(n) {
        while (substr(addr,length(addr))==","){
            FS=" "
            getline
            addr=addr $1
            FS="\t"
            }
        gsub("[()]","",addr)
        }
  print nick" = "name" = "addr
}
' $HOME/.addressbook