Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Anyone know of an egrep command which will show the authors and subjects of all mails contained in some directory?

share|improve this question

1 Answer 1

Maybe something like:

egrep '^(From|Subject):' *

This will match From: or Subject: at the beginning of a line, which is approximately what you want.

share|improve this answer
    
That looks good, but how will that show From and Subject? –  user15770 Feb 21 '12 at 12:42
    
That's exactly what it does. Have you tried it? –  larsks Feb 21 '12 at 12:46
    
Does the star at the end act as a kleene star? –  user15770 Feb 21 '12 at 12:48
    
No. For the behavior of the star at the end, see the bash(1) man page. Note that the star is not part of the regular expression. –  larsks Feb 21 '12 at 14:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.