peet(1)
π peet β piped reverse tee, but make it bestie energy π
okay so this is the manual for peet, which lives in section 1 of the manual (that's the "User Commands" section, iykyk). It's a little tool that reads from a whole pile of file descriptors and copies literally everything into one single file descriptor. Reverse tee. Tee but backwards. It's giving unhinged plumbing in the best way π
β¨ NAME β¨
peet β piped reverse tee: read from many file descriptors and copy to one π«Ά
πΈ SYNOPSIS πΈ
peet [-h] [-b size] [-w outfd] infd1 [infd2 ...]
like. that's it. that's the whole vibe.
π¦ DESCRIPTION π¦
So peet reads from a bunch of file descriptors and copies all of it to one file descriptor. And if you don't hand it a file descriptor to write to (aka you skip the -w option), it just defaults to 1, which is stdout. Classic. Reliable. Iconic.
Now here's the tea β β peet without the -b option reads whatever data is available on each fd and writes it straight out to the output file descriptor. For each input fd, one read happens. That read grabs a maximum of 4096 bytes at a time. And for each read, one write happens.
β οΈ bestie listen β this means the output data might be scattered randomly between the different input streams. It's not gonna come out all neat and ordered. It's a chaos girlie and that's the deal.
When you do specify the -b option, that number is seen as bytes in a block. A write only gets executed when there are complete blocks in the input buffer. So it waits for full blocks before it ships anything out. Patient queen. π
And fun fact: peet can be used together with pipexec(1) to de-multiplex text based output. Very slay, very demux. π
π OPTIONS π
-hβ print help and version information. the little "hi bestie here's what I do" moment β¨-b numβ Reads alwaysnumbytes before writing them. waits for the full block, no crumbs π-w outfdβ use the givenoutfdas output file descriptor. If this option is not specified,1(stdout) is used. the default is always the default fr fr
π EXAMPLES π
Example one: read from stdin (fd 0), and file descriptors 9 and 11 and write to stdout. π¦
peet 0 9 11
Example two: using pipexec(1). Start two commands, both write their log to stdout, and use one instance of rotatelogs(1) to write the logs to disk into a common log file. (The file descriptors 8 and 11 are chosen by random β random queen behavior, no notes.) π
pipexec [ CMD1 /usr/bin/cmd1 ] [ CMD2 /usr/bin/cmd2 ] \
[ PEET /usr/bin/peet 8 11 ] \
[ RLOGS /usr/bin/rotatelogs /var/log/%Y%m%d_cmd.log ] \
"{CMD1:1>PEET:8}" "{CMD2:1>PEET:11}" \
"{PEET:1>RLOGS:0}"
like look at that. two commands, one peet, one rotatelogs, all holding hands. the file descriptor wiring is giving main character energy and honestly? obsessed. π«Ά
π SEE ALSO π
pipexec(1), peet(1), rotatelogs(1), tee(1)
(yes peet(1) is in the SEE ALSO of peet(1). self-love. we stan a confident manual page. π)
π AUTHOR π
Written by Andreas Florath (andreas@florath.net) β thank you for the gift, king β¨
π COPYRIGHT π
Copyright Β© 2015,2023 by Andreas Florath (andreas@florath.net). License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.
ok that's the whole page, you're fully caught up, no cap π§
and that's a wrap on the User Commands version, dated 2023-03-27, page peet(1) β go forth and reverse-tee responsibly, bestie ππΈπ
π¦ where this page comes from
- alpine 3.24: pipexec-doc 2.6.2-r0 Β· GPL-2.0-or-later
- debian trixie: pipexec 2.6.2-1 Β· GPL-2.0-or-later
- ubuntu questing: pipexec 2.6.2-1
- ubuntu resolute: pipexec 2.6.2-1build1 Β· GPL-2.0-or-later
- ubuntu stonking: pipexec 2.6.2-1build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms