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

Re: SED Question



On 20:26 06 Mar 2002, Vidiot <brown mrvideo vidiot com> wrote:
| >Hey everyone, I am trying to make a "FROM" script that basically shows =
| >the person running the script who the mail is from that they have.
|
| How about:
| 
| 	sed -e '/^From /b' -e d
| 
| The only legal from at the beginning is "From "

Too verbose:

	sed 1q

works fine since "From " is the first line.

However, that's the envelope. May well _not_ be the author after passing through a mailing
list or gateway. If you want the "From:" line:

	sed -n '/^[Ff][Rr][Oo][Mm]:/p'

will do the trick.
--
Cameron Simpson, DoD#743        cs zip com au    http://www.zip.com.au/~cs/

In life, you should always try to know your strong points, but this is
far less important than knowing your weak points.
Martin Fitzpatrick <mfitzpatrick scot bbc co uk>





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