Tim Whitehead wrote:
> The resulting line from that was
> my_hdr X-Operating-System: `uname -rsm` `uptime | sed s/.*up/up/ | sed
>s/,[[:space:]0-9]*users.*$//`
>
> so I adopted it to
> my_hdr X-Mailer: `mutt -v| grep Mutt -n|grep 1:|sed s/.*Mutt/Mutt/`
>
> As you can see this is a round about way of doing it... But it also leaves on
> the day I compiled this version of Mutt. What would be the best way to chop that
> date off?
For one thing, Mutt already includes a "User-Agent:" header line.
Is it really necessary to duplicate that information in an
"X-Mailer:" line?
If so, then this should do what you want:
my_hdr X-Mailer: `mutt -v | sed s/"[:space:]*(.*"//`
(Because it is line oriented, only the first line of output from
the command should be substituted, eliminating your greps.)
By the way, your "X-Operating-System:" my_hdr could be simplified
slightly by this:
my_hdr X-Operating-System: `uname -smr` `uptime | sed \
's/.*\(up.*\),\ \+[0-9]\+\ user.*/\1/'`
This uses only one sed command rather than two. It's generally
better to use fewer processes when possible. :o)
-- Mr. Wade
--
Linux: The Choice of the GNU Generation