home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / question / 15789 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  889 b 

  1. Path: sparky!uunet!paladin.american.edu!howland.reston.ans.net!spool.mu.edu!agate!doc.ic.ac.uk!warwick!uknet!bhamcs!dmp
  2. From: dmp@cs.bham.ac.uk (Donald Peterson)
  3. Newsgroups: comp.unix.questions
  4. Subject: sed and email addresses
  5. Message-ID: <C15nzq.BqK@cs.bham.ac.uk>
  6. Date: 20 Jan 93 13:55:01 GMT
  7. Sender: news@cs.bham.ac.uk
  8. Organization: Cognitive Science, Birmingham, UK
  9. Lines: 23
  10. Nntp-Posting-Host: fattie
  11.  
  12.  
  13. I need to use a stream editor (eg sed or awk) to extract email
  14. addresses from accumulated email. Using fgrep I get lines like
  15.  
  16.     From: person's name <person@address>
  17.  
  18. and
  19.  
  20.     From: person@address (person's name)
  21.  
  22. etc.
  23.  
  24. Can anyone tell me what is the sed or awk command for "pick out the
  25. string with SPACE, < or ( at the left, @ in the middle, and SPACE, >
  26. or ) in the right, no SPACEs in between?
  27.  
  28. Please email me direct:
  29.  
  30. Thanks,
  31.  
  32. Donald Peterson.
  33.  
  34. email: D.M.Peterson@cs.bham.ac.uk
  35.