GET-HEADER
Section: User Commands (1)
Updated: $Revision: 1.5 $
Index
Return to Main Contents
NAME
get-header - extract a header field from a mail message or news article
SYNOPSIS
get-header
[ -f ]
[ -i ]
[ -w ]
fieldname
[
default
]
<
message
COPYRIGHT
Copyright © 1989 Howard Lee Gayle
DESCRIPTION
Get-header
reads from standard input the header
(up to the first blank line)
of a mail message or news article.
It looks for the first occurrence of the given
fieldname.
If found, it writes the value to standard output.
Otherwise, if there is a default value it writes that.
OPTIONS
- -f
-
Assume the field is an address field,
e.g.
a From: field.
Try to find the full name, using
msgfn(3).
- -i
-
Ignore case (upper or lower) of the field name.
- -w
-
Strip leading spaces and tabs before writing the value of the field.
EXAMPLE
To print the subject, or "none" if there is no Subject: field:
% get-header -i subject none < message
Get-header
could also be used to pull fields out of very simple data files,
e.g.
Name: Howard Gayle
Phone: +46 8 719 5565
Favorite Brahms symphony: 4
SEE ALSO
msgfn(3 -lhoward).
article(1)
in
Kent Landfield's
rkive
system.
This appeared in
comp.sources.unix
on
30 June 1989
as
volume 19 issues 98-101.
LICENSE
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 1,
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
AUTHOR
Howard Gayle,
TN/ETX/T/BG,
Ericsson Telecom AB,
S-126 25 Stockholm,
Sweden,
howard@ericsson.se,
uunet!ericsson.se!howard,
Phone: +46 8 719 5565,
FAX: +46 8 719 9598,
Telex: 14910 ERIC S
Index
- NAME
-
- SYNOPSIS
-
- COPYRIGHT
-
- DESCRIPTION
-
- OPTIONS
-
- EXAMPLE
-
- SEE ALSO
-
- LICENSE
-
- AUTHOR
-
This document was created by
man2html,
using the manual pages.
Time: 21:53:05 GMT, February 02, 2023