funnel(1)

πŸ’– funnel(1) πŸ’–

okay bestie, you know how your fave show is on and you wanna watch it on your laptop AND your TV AND your phone at the same time? that's the vibe. this is funnel, from the logtools crew, and she splits one lil pipe stream into one or more files or programs. one input, many outputs. iconic behaviour honestly. ✨


🌸 SYNOPSIS 🌸

funnel [|] [>[>]file] [|process]

πŸ¦‹ DESCRIPTION πŸ¦‹

so funnel reads data from standard input and writes it out to several output streams at once. she's a splitter, she's a multitasker, she's doing the most and we love her for it. πŸ’…

here's how the lil symbols work:

  • the | symbol means "copy standard input to standard output." yes literally just pass it through, bestie. she's in the group chat too.
  • the > symbol means a file name comes immediately right after it β€” no separating spaces, not even one, fr fr. the file gets truncated if it already exists, or created if it doesn't.
  • the >> version means the file gets appended to if it exists. no wiping, just adding. respectful. 🫢
  • a | symbol followed immediately by text means that text is a command, and it gets run by system(), with all the input piped straight into it. give her a job and she'll feed it. 😌

⭐ EXIT STATUS ⭐

  • 0 β€” no errors, we ate and left no crumbs πŸ’–
  • 1 β€” error opening input, sad girl hours 😭
  • anything else β€” that's 100 + the number of commands or files that failed. yeah. she counts them. she remembers. πŸ‘‘

🌈 FEATURES 🌈

she uses popen (3) for output, which means shell expansion does get performed. cute, right? ✨

but listen β€” if you want that shell expansion, you have to quote your parameters correctly so that they get expanded by popen (3) and not by the shell that calls funnel. quote it right or it's giving chaos. πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

this program, its manual page, and the Debian package were all written by Russell Coker <russell@coker.com.au>. king behaviour. πŸŽ€


πŸ’œ SEE ALSO πŸ’œ

  • popen(3)

okay that's the whole page bestie, ty for coming to my ted talk, go split some streams and slay πŸ’…βœ¨

this was Russell Coker <russell@coker.com.au>, version 0.06, and it's a funnel(1) situation β€” mwah, bye πŸ¦‹