Re: [OT] well slightly
On (08/04/01 23:05), Luke Ravitch wrote: As an aside, what version of Mutt do you use? On 1.2.4, I don't see From his headers... User-Agent: Mutt/1.2.5i Ailbhe -- Homepage: http://ailbhe.ossifrage.net/
Re: [OT] well slightly
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
Re: [OT] well slightly
Wade A. Mosely ([EMAIL PROTECTED]) said something to this effect on 04/09/2001: Tim Whitehead wrote: my_hdr X-Mailer: `mutt -v | sed s/"[:space:]*(.*"//` I think I'd do it like this: my_hdr X-Mailer: `mutt -v | head -1 | awk '{printf "%s %s", $1, $2}'` (darren) -- Historically speaking, the presence of wheels in Unix has never precluded their reinvention. -- Larry Wall
Re: [OT] well slightly
I've since added these lines to my .muttrc set user_agent=no my_hdr X-Operating-System: `uname -smr` `uptime | sed \ 's/.*\(up.*\),\ \+[0-9]\+\ user.*/\1/'` my_hdr X-Mailer: `mutt -v | head -1 | awk '{printf "%s %s", $1, $2}'` thanks for the help! tw
[OT] well slightly
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? thanks, tw
Re: [OT] well slightly
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