On Mon, Apr 09, 2001 at 12:23:06AM -0500, Tim Whitehead wrote:
>
> I just recently got an email from my sister an noticed that Netscape puts an
> X-Mailer in the header. This started a mini-quest to get the equivalent into
> mine. I delved into the man pages of grep, sed and awk only to find that my best
> solution came from you guys from my last question concerning the
> X-Operating-System problem.
>
> 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?
Add this to the end (well, before the closing quote):
|cut -f1-2 -d' '
As an aside, what version of Mutt do you use? On 1.2.4, I don't see
any use for the sed bit. I guess your output must be be a little
different. Just in case, what the cut command above does is include
just the first two fields of the line, treating fields as
space-delimited. So, on my box, it takes the output of your line:
Mutt 1.2.4i (2000-07-07)
And spits out everything before the second space. You may need to
modify it a bit if you're dealing with something slightly different.
--
Luke