Re: SED Question

2002-03-07 Thread Cameron Simpson

On 00:41 07 Mar 2002, Vidiot [EMAIL PROTECTED] wrote:
| This is actually false. For the envelope (From ) it's true, but for
| the mail headers (the envelope's not part of the headers) the header name
| is case insensitive. Have a look at RFC2822 - an enlightening document.
| Cameron Simpson, DoD#743[EMAIL PROTECTED]http://www.zip.com.au/~cs/
| 
| I've never seen From: be anything but as I typed it.  Interesting.

No good mail client will damage what you type, and so if you type
From: that's how it will stay. But it _is_ legal to supply froM:
or any other wierd case combination.
-- 
Cameron Simpson, DoD#743[EMAIL PROTECTED]http://www.zip.com.au/~cs/

This should be good fun. It's been a while since the group has had such a
ripe opportunity to gut, gill, and fillet some poor bastard. Ah well. Off to
get the popcorn...
- [EMAIL PROTECTED] (Robert Beauchaine)



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



SED Question

2002-03-06 Thread Jake McHenry



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. Not very complex, but I can't seem to get it exactly how I want it. 
Currently, it works fine, but it shows too much info. This is what I 
have...

 cat /var/spool/mail/$uname | sed -e 
'/[Ff][Rr][Oo][Mm]:/b' -e d

K, this shows all combinations of from:, which is 
kind of what I want, but I only want the from: at the beginning of a email, not 
all the from: in reply's etc...

Can anyone help me out with this?


Thanks,
Jake


Re: SED Question

2002-03-06 Thread Vidiot


This is a multi-part message in MIME format.

--=_NextPart_000_0005_01C1C552.B5297DF0
Content-Type: text/plain;
   charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

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. Not =
very complex, but I can't seem to get it exactly how I want it. =
Currently, it works fine, but it shows too much info. This is what I =
have...

  cat /var/spool/mail/$uname | sed -e '/[Ff][Rr][Oo][Mm]:/b' -e d

K, this shows all combinations of from:, which is kind of what I want, =
but I only want the from: at the beginning of a email, not all the from: =
in reply's etc...

Can anyone help me out with this?

How about:

sed -e '/^From /b' -e d

The only legal from at the beginning is From 

MB



Thanks,
Jake

--=_NextPart_000_0005_01C1C552.B5297DF0
Content-Type: text/html;
   charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
HTMLHEAD
META http-equiv=3DContent-Type content=3Dtext/html; =
charset=3Diso-8859-1
META content=3DMSHTML 6.00.2713.1100 name=3DGENERATOR
STYLE/STYLE
/HEAD
BODY bgColor=3D#ff
DIVFONT face=3DArial size=3D2Hey everyone, I am trying to make a =
FROM script=20
that basically shows the person running the script who the mail is from =
that=20
they have. Not very complex, but I can't seem to get it exactly how I =
want it.=20
Currently, it works fine, but it shows too much info. This is what I=20
have.../FONT/DIV
DIVFONT face=3DArial size=3D2/FONTnbsp;/DIV
DIVFONT face=3DArial size=3D2nbsp; cat /var/spool/mail/$uname | sed =
-e=20
'/[Ff][Rr][Oo][Mm]:/b' -e d/FONT/DIV
DIVFONT face=3DArial size=3D2/FONTnbsp;/DIV
DIVFONT face=3DArial size=3D2K, this shows all combinations of =
from:, which is=20
kind of what I want, but I only want the from: at the beginning of a =
email, not=20
all the from: in reply's etc.../FONT/DIV
DIVFONT face=3DArial size=3D2/FONTnbsp;/DIV
DIVFONT face=3DArial size=3D2Can anyone help me out with =
this?/FONT/DIV
DIVFONT face=3DArial size=3D2/FONTnbsp;/DIV
DIVFONT face=3DArial size=3D2/FONTnbsp;/DIV
DIVFONT face=3DArial size=3D2Thanks,/FONT/DIV
DIVFONT face=3DArial size=3D2Jake/FONT/DIV/BODY/HTML

--=_NextPart_000_0005_01C1C552.B5297DF0--




___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



-- 
e-mail: [EMAIL PROTECTED]   It is God's job to forgive bin Laden.
It is our job to set up the meeting.
U.S. Marine Corp.
Visit - URL: http://www.vidiot.com/  (Your link to Star Trek and UPN)



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



SOLVED: Re: SED Question

2002-03-06 Thread Jake McHenry

Awesome, Thanks!!

Jake

- Original Message -
From: Vidiot [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 06, 2002 9:26 PM
Subject: Re: SED Question


 
 This is a multi-part message in MIME format.
 
 --=_NextPart_000_0005_01C1C552.B5297DF0
 Content-Type: text/plain;
  charset=iso-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 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. Not =
 very complex, but I can't seem to get it exactly how I want it. =
 Currently, it works fine, but it shows too much info. This is what I =
 have...
 
   cat /var/spool/mail/$uname | sed -e '/[Ff][Rr][Oo][Mm]:/b' -e d
 
 K, this shows all combinations of from:, which is kind of what I want, =
 but I only want the from: at the beginning of a email, not all the from:
=
 in reply's etc...
 
 Can anyone help me out with this?

 How about:

 sed -e '/^From /b' -e d

 The only legal from at the beginning is From 

 MB


 
 Thanks,
 Jake
 
 --=_NextPart_000_0005_01C1C552.B5297DF0
 Content-Type: text/html;
  charset=iso-8859-1
 Content-Transfer-Encoding: quoted-printable
 
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN
 HTMLHEAD
 META http-equiv=3DContent-Type content=3Dtext/html; =
 charset=3Diso-8859-1
 META content=3DMSHTML 6.00.2713.1100 name=3DGENERATOR
 STYLE/STYLE
 /HEAD
 BODY bgColor=3D#ff
 DIVFONT face=3DArial size=3D2Hey everyone, I am trying to make a =
 FROM script=20
 that basically shows the person running the script who the mail is from =
 that=20
 they have. Not very complex, but I can't seem to get it exactly how I =
 want it.=20
 Currently, it works fine, but it shows too much info. This is what I=20
 have.../FONT/DIV
 DIVFONT face=3DArial size=3D2/FONTnbsp;/DIV
 DIVFONT face=3DArial size=3D2nbsp; cat /var/spool/mail/$uname | sed
=
 -e=20
 '/[Ff][Rr][Oo][Mm]:/b' -e d/FONT/DIV
 DIVFONT face=3DArial size=3D2/FONTnbsp;/DIV
 DIVFONT face=3DArial size=3D2K, this shows all combinations of =
 from:, which is=20
 kind of what I want, but I only want the from: at the beginning of a =
 email, not=20
 all the from: in reply's etc.../FONT/DIV
 DIVFONT face=3DArial size=3D2/FONTnbsp;/DIV
 DIVFONT face=3DArial size=3D2Can anyone help me out with =
 this?/FONT/DIV
 DIVFONT face=3DArial size=3D2/FONTnbsp;/DIV
 DIVFONT face=3DArial size=3D2/FONTnbsp;/DIV
 DIVFONT face=3DArial size=3D2Thanks,/FONT/DIV
 DIVFONT face=3DArial size=3D2Jake/FONT/DIV/BODY/HTML
 
 --=_NextPart_000_0005_01C1C552.B5297DF0--
 
 
 
 
 ___
 Redhat-list mailing list
 [EMAIL PROTECTED]
 https://listman.redhat.com/mailman/listinfo/redhat-list
 


 --
 e-mail: [EMAIL PROTECTED]   It is God's job to forgive bin Laden.
 It is our job to set up the meeting.
 U.S. Marine Corp.
 Visit - URL: http://www.vidiot.com/  (Your link to Star Trek and UPN)



 ___
 Redhat-list mailing list
 [EMAIL PROTECTED]
 https://listman.redhat.com/mailman/listinfo/redhat-list






___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: SED Question

2002-03-06 Thread Cameron Simpson

On 20:26 06 Mar 2002, Vidiot [EMAIL PROTECTED] 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[EMAIL PROTECTED]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 [EMAIL PROTECTED]



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: SED Question

2002-03-06 Thread Vidiot

On 20:26 06 Mar 2002, Vidiot [EMAIL PROTECTED] 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.

Doesn't that work with only 1 piece of mail in the mailbox?  Most mail boxes
have more than one piece of mail.

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.

That is true.  But you might want to know that it is from a mail list AND
who the original sender is.

Then you might want:

sed -e '/^From[: ]/p'

That will print both lines.  Looking for anything other than From is
a waste, because by definition the case is only as shown.

MB
-- 
e-mail: [EMAIL PROTECTED]   It is God's job to forgive bin Laden.
It is our job to set up the meeting.
U.S. Marine Corp.
Visit - URL: http://www.vidiot.com/  (Your link to Star Trek and UPN)



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: SED Question

2002-03-06 Thread John H Darrah

On Wed, 6 Mar 2002, Jake McHenry 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. Not very complex, but I can't seem
 to get it exactly how I want it. Currently, it works fine,
 but it shows too much info. This is what I have...

   cat /var/spool/mail/$uname | sed -e '/[Ff][Rr][Oo][Mm]:/b' -e d

 K, this shows all combinations of from:, which is kind of
 what I want, but I only want the from: at the beginning of
 a email, not all the from: in reply's etc...


The `frm' command which is included as part of the elm
package is designed to do exactly what you want. It will
display the sender and the subject line for each message in
your mailbox.


-- 
John Darrah (u05192)| Dept: N/C Programming
Giddens Industries  | Ph: (425) 353-0405 #133
PO box 3190 | Ph: (206) 767-4212 #133
Everett  WA98203| Fx: (206) 764-9639



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: SED Question

2002-03-06 Thread Cameron Simpson

On 21:55 06 Mar 2002, Vidiot [EMAIL PROTECTED] wrote:
| On 20:26 06 Mar 2002, Vidiot [EMAIL PROTECTED] 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.
| 
| Doesn't that work with only 1 piece of mail in the mailbox?  Most mail boxes
| have more than one piece of mail.

I read his request to be per-mail item. (Eg for announcement on mail arrival.)
Besides, _my_ mail is stored one message per file :-)

But sure, for a standard UNIX mail box one might want this:

sed -n '/^From /p'
or
sed '/^From /d'

| 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.
| 
| That is true.  But you might want to know that it is from a mail list AND
| who the original sender is.

Generally From  has been comparatively irrelevant in my experience
except for forensic purposes, and even then I tend to want Received: etc.
Once you start wanting that level of detail he might want any header...

| Then you might want:
|   sed -e '/^From[: ]/p'
| That will print both lines.  Looking for anything other than From is
| a waste, because by definition the case is only as shown.

This is actually false. For the envelope (From ) it's true, but for
the mail headers (the envelope's not part of the headers) the header name
is case insensitive. Have a look at RFC2822 - an enlightening document.

Cheers,
-- 
Cameron Simpson, DoD#743[EMAIL PROTECTED]http://www.zip.com.au/~cs/

The impossible we understand right away - the obvious takes a little longer.



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list



Re: SED Question

2002-03-06 Thread Vidiot

This is actually false. For the envelope (From ) it's true, but for
the mail headers (the envelope's not part of the headers) the header name
is case insensitive. Have a look at RFC2822 - an enlightening document.
Cameron Simpson, DoD#743[EMAIL PROTECTED]http://www.zip.com.au/~cs/

I've never seen From: be anything but as I typed it.  Interesting.

MB
-- 
e-mail: [EMAIL PROTECTED]   It is God's job to forgive bin Laden.
It is our job to set up the meeting.
U.S. Marine Corp.
Visit - URL: http://www.vidiot.com/  (Your link to Star Trek and UPN)



___
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list