MSED(1)

πŸ’… MSED(1) β€” the manual page, but make it cute

okay bestie, we're doing msed today β€” it's a General Commands Manual page, and it's literally about manipulating message headers. buckle up πŸŽ€


✨ NAME ✨

msed β€” manipulate message headers πŸ’Œ


🌸 SYNOPSIS 🌸

msed script [msgs ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea, bestie: msed prints out the messages msgs, but with their message headers transformed by the commands you put in script. πŸͺ„ (btw if you're confused about how message arguments even work, go read mmsg(7) β€” it's giving "the syllabus", iykyk.)

And if you pass no msgs at all? No worries, she just defaults to the current message. main character energy, honestly. πŸ‘‘

Now, msed scripts are like a subset of sed(1) scripts, except optimized for modifying messages. 🌈 But lowkey important: msed unfolds and normalizes message headers, so they might need to be passed through mmime(7) to make sure they're RFC 5322 conformant. The message body? Untouched. Not her business. She doesn't look at it. πŸ’…

msed supports the following commands. The separators after the command letter can be swapped out for an arbitrary symbol, just like in sed(1). And you can stack multiple commands by separating them with β€˜;’. slay.

  • /header/a/value/ β€” if the header β€˜header:’ isn't set in the message, add it with the value you gave. simple as that. ✨
  • /headers/c/value/ β€” change colon-separated headers matching the regular expression headers (with implicit anchoring to the header name, so she knows what she's about) to the value given in value. πŸŽ€
  • /headers/d β€” delete colon-separated headers matching the regular expression headers, with implicit anchoring to the header name. If you want to match arbitrary strings at the beginning or end of the headers, you gotta use an explicit β€˜.*’ β€” be specific, bestie.

For example, β€˜/x-.*/d’ will delete all headers starting with β€˜X-’ (and it's always case insensitive, no cap), and β€˜/from:to:cc/d’ will delete the headers β€˜From:’, β€˜To:’, and β€˜Cc:’. bye girlies πŸ‘‹

  • [/headers/]s/regex/replacement/[flags] β€” substitute matches of the POSIX Basic Regular Expression regex in headers matching the POSIX Basic Regular Expression headers, with implicit anchoring to the header name (or all headers, if you omit it), with the string replacement. The β€˜&’ expands to the matched string, and β€˜\N’ expands to the Nth sub-expression, where N is between 1 and 9. 🧚

If flags contains the letter β€˜d’, the header is removed if regex matched. πŸ—‘οΈ

By default, only the first match is replaced β€” unless flags contains the letter β€˜g’. πŸ’–

By default, regex is matched case sensitively β€” unless flags contains the letter β€˜i’. πŸ™ˆ


πŸ’€ EXIT STATUS πŸ’€

The msed utility exits 0 on success, and >0 if an error occurs. that's it, that's the vibe check.


🌟 SEE ALSO 🌟

sed(1), mhdr(1), mmsg(7), regex(7) / re_format(7)


πŸ‘‘ AUTHORS πŸ‘‘

Leah Neukirchen <leah@vuxu.org> πŸ’œ


πŸ“œ LICENSE πŸ“œ

msed is in the public domain. 🫢

To the extent possible under law, the creator of this work has waived all copyright and related or neighboring rights to this work.

http://creativecommons.org/publicdomain/zero/1.0/


no cap, that's the whole page. every flag, every regex, every header. periodt. πŸ’…βœ¨

and that's a wrap bestie β€” this was MSED(1) from the Debian manual set, dated August 1, 2016. go forth and edit those headers, you absolute icon πŸŽ€πŸ¦‹πŸ’–