snsplit,v0.3.8(8)
β¨ snsplit β split an article stream into individual articles β¨
okay bestie, welcome to snsplit, version v0.3.8, straight out of the System Manager's Manual π
she's a tiny little program with big "cut the stream into pieces" energy and honestly? obsessed.
πΈ NAME πΈ
snsplit β split an article stream into individual articles π
π¦ SYNOPSIS π¦
snsplit [-r] [field... -] prog...
like. that's it. that's the whole vibe. short king π«Ά
π DESCRIPTION π
okay so here's the tea: snsplit reads an article stream from descriptor 0 and splits it into separate articles, then invokes prog... on each one, with the article available on descriptor 0. so every program you list gets handed one article at a time on its stdin. it's giving quick-and-dirty way of filtering an article stream β and we mean that as a compliment, lowkey. π₯
the incoming article stream is expected to be in wire format, bestie. that means:
- lines ending in
CRLF - leading dots doubled
- delimited by a dot on a line by itself
then the article that actually gets presented to prog... is a whole different girl β she's been cleaned up:
- her lines end in a bare newline
- all her header lines are unfolded
- leading dots are unstuffed
- and she's terminated by end-of-file
so like, glow-up complete β¨ the wire format is the messy group-chat screenshots and what prog... sees is the polished carousel post. periodt.
π ARGUMENTS π
prog...β is the program (with arguments) to run on each article. ifprog...exits with any kind of failure,snsplitaborts. no second chances, no "maybe next article", she said nope πfield... -β are optional header field names. if these are specified, the value of the first header field of that name will be exported into the environment. thisfield...list must be terminated by the hyphen. see also ENVIRONMENT below π
β¨ OPTIONS β¨
-rβ expect input articles in rnews batch format instead. that's it. that's the only flag. she's minimal and she knows it π
π ENVIRONMENT π
snsplit sets some environment variables, bestie. and if the environment already contains these variables, they will be overwritten β no negotiating, no asking, she just does it. π
SEQUENCEβ if already set to a positive value, it is incremented for the first article. if it isn't set, it is set to one for the first article. thereafter it is incremented for each subsequent article. the value is always a 6-digit number with leading zeroes, and yes, it can roll over. little odometer energy ππ¨BYTESβ contains the size of the current article.HEAD_LINESβ the number of lines in the head of the article, excluding the blank separator line.BODY_LINESβ the number of lines in the body of the article, excluding the blank separator line.FLD_FIELDβ if any fields are specified on the command line, where field is the name of an article header field, thenFLD_FIELDwill be set to the value of field, whereFIELDis the same as field but with lower case characters changed to upper case, and all hyphens changed to underscores. confusing? yeah bestie, same π here's the example: if field ismessage-id, thenFLD_MESSAGE_IDwill be set to the value of the firstMessage-IDfield in the current article, if there is one.
so it's field in,SCREAMING_SNAKE_CASEout. the way thatmessage-idbecomesFLD_MESSAGE_IDβ¦ transformation of the century fr fr π
π₯ EXIT CODES π₯
- exits
0on success π - exits
1on usage error - exits
2on system error - exits
3on article format error
and if prog... exits with other than 0, snsplit will also exit that value. she passes the message along, she's a good friend like that π«Ά
π SEE ALSO π
okay there's genuinely nothing here in the original β no cross-references, no sibling pages. she stands alone. main character energy, no supporting cast π β¨
π§ N.B. π§
that's the whole page, bestie! every flag, every variable, every exit code, every CRLF β we kept it all. no cap.
and a lil cute sign-off: this iconic little manual page is brought to you by Harold Tay π β from the System Manager's Manual, version snsplit,v0.3.8. slay, go filter some article streams, and remember: bare newline in, wire format out, iykyk ππ¦πΈ
π¦ where this page comes from
- debian bookworm: sn 0.3.8-12
- ubuntu jammy: sn 0.3.8-12
- ubuntu noble: sn 0.3.8-12
- ubuntu resolute: sn 0.3.8-12
- ubuntu stonking: sn 0.3.8-12
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms