You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mblaze/contrib/mfillmid

15 lines
321 B
Bash

#!/bin/sh
# mfillmid - fill in files for message-ids (via mairix)
exec awk '
function q(a) { gsub("\\47", "\47\\\47\47", a); return "\47"a"\47" }
/<..*>/ {
match($0, "<..*>")
mid = substr($0, RSTART+1, RLENGTH-2)
if ("mairix -r m:" q(mid) | getline file) {
print substr($0, 0, RSTART-1) file
next
}
}
{ print }'