The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

grab .contactemail adresses

Discussion in 'E-mail Discussions' started by cyon, Jun 11, 2004.

  1. cyon

    cyon Well-Known Member
    PartnerNOC

    Joined:
    Jan 15, 2003
    Messages:
    320
    Likes Received:
    0
    Trophy Points:
    16
    hi guys,

    I'd like to read out all the e-mailadresses in .contactemail to import this adresses in my own newslettersystem.

    Code:
    cat /home/*/.contactemail > emails.txt
    doesnt work, because I got emai@domain1.comemail@domain2.com...

    Is there a way to insert a linebreak after each adress?

    Or is there a better way to grab all this adresses?

    Thank you for your help and ideas.
     
  2. coastinc

    coastinc Well-Known Member

    Joined:
    Mar 13, 2002
    Messages:
    159
    Likes Received:
    0
    Trophy Points:
    16
    If you'd like, I can make you a short perl script that would do that.... Just drop me an e-mail and I'll be more than glad to do so.
     
  3. registerpol

    registerpol Member

    Joined:
    Feb 25, 2003
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Montreal
    bump
     
    #3 registerpol, Jun 11, 2004
    Last edited: Jun 11, 2004
  4. darksoul

    darksoul Active Member

    Joined:
    Feb 20, 2003
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    for i in `awk -F: '/home/ {print $1};' /etc/passwd`
    do
    email=`cat /home/$i/.contactemail`
    if test -n "$email"; then
    echo $email >> list.txt
    fi
    done
     
    #4 darksoul, Jun 13, 2004
    Last edited: Jun 13, 2004
  5. cyon

    cyon Well-Known Member
    PartnerNOC

    Joined:
    Jan 15, 2003
    Messages:
    320
    Likes Received:
    0
    Trophy Points:
    16
    @darksoul: thank you very very much, your scripts works great!

    @coastnic: thank you for your offer, but darksoul helped me already.
     

Share This Page