AP(8mh)

πŸ“¦
version 1.8 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’Œ AP(8mh) β€” bestie, let's talk about ap πŸ’Œ

okay so you found the 8mh manual, section 8, and the star of the show is ap β€” the nmh parser of RFC 822-style addresses. she reads addresses the way the internet officially says they should be read, and honestly? she ate. πŸ’…


✨ SYNOPSIS ✨

/usr/lib/mh/ap [-help] [-version] [-form formatfile] [-format string]
     [-width columns] addrs ...

no cap, that's the whole vibe. you hand her some addrs and she tells you what they actually mean. πŸ¦‹


🌸 DESCRIPTION 🌸

ap is a program that parses addresses according to the ARPA Internet standard. she also understands many non-standard formats β€” she's flexible like that, she contains multitudes. πŸ’– she is useful for seeing how nmh will interpret an address, which is lowkey the whole point. iykyk.

here's the tea: the ap program treats each argument as one or more addresses, and prints those addresses out in the official RFC 822 format. ✨ which means it is usually best to enclose each argument in quotes for the shell β€” otherwise your shell is gonna start interpreting things and it's giving chaos. πŸ™ˆ


πŸŽ€ overriding the output format πŸŽ€

to override the output format used by ap, the -format string or -format file switches are used. this permits individual fields of the address to be extracted with ease. the string is simply a format string, and the file is simply a format file. see mh-format(5) for the details. πŸ“š

in addition to the standard escapes, ap also recognizes the following additional escape:

  • error β€” returns a string: a diagnostic if the parse failed

πŸ’œ the default format string πŸ’œ

here is the default format string used by ap, and bestie she is iconic:

%<{error}%{error}: %{text}%|%(putstr(proper{text}))%>

which says that if an error was detected, print the error, a :, and the address in error. otherwise, output the RFC 822-proper format of the address. periodt. πŸ‘‘


πŸ“ FILES πŸ“

  • $HOME/.mh_profile β€” the user's profile.
  • /etc/nmh/mts.conf β€” the mts configuration file.

🧚 PROFILE COMPONENTS 🧚

None

(yes bestie, literally none. nothing. empty. she needs nothing from you. main character energy fr fr.)


πŸ”₯ SEE ALSO πŸ”₯


⭐ DEFAULTS ⭐

  • -format β€” as described above.
  • -width β€” the width of the terminal.

🌈 CONTEXT 🌈

None

again β€” none. she's unbothered. she's free. πŸ•ŠοΈ


πŸ’€ heads up bestie: the manpage header calls this AP(8mh), the manual section is 8mh, and the binary lives at /usr/lib/mh/ap. don't @ me, that's just where she lives. 🏠

and that's the whole page!! this one shipped as nmh-1.8, dated 2013-12-05 β€” vintage but still slaying. mwah, go parse something. πŸ’‹ 🫢

πŸ“¦ where this page comes from