PSUB(1)

πŸ’… PSUB(1) β€” like, the actual manual page, bestie

okay so this is psub, and it lives in the fish-shell universe, which is honestly the most iconic manual section name ever. sit down, grab a strawberry πŸ“, and let me tell you about process substitution because it's giving genius and you're gonna be obsessed.


✨ NAME ✨

psub β€” perform process substitution. that's it. that's the whole name. short, sweet, main character energy πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

COMMAND1 ( COMMAND2 | psub [-F | --fifo] [-f | --file] [(-s | --suffix) SUFFIX] )

literally just memorize that shape and you're set, no cap.


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so some shells β€” we're talking ksh, bash, the classics β€” have this syntax that's like a mashup between command substitution and piping. it's called process substitution, and it's used to send the output of a command into the calling command, much like command substitution does. BUT πŸ’… here's the twist: the output is not sent through commandline arguments. instead it goes through a named pipe, and the filename of that named pipe gets sent as an argument to the calling program. iykyk.

and here's where psub comes in: psub combined with a regular command substitution gives you the exact same functionality. so you're not missing out on anything, bestie.

the following options are available, and yes we're going through all of them:

  • -f, --file β€” use a regular file instead of a named pipe to communicate with the calling process. lowkey this makes psub significantly slower when large amounts of data are involved 😭 but the glow-up is that the reading process can seek in the stream. and fun fact: this is the default. it's iconic like that.
  • -F, --fifo β€” use a named pipe rather than a file. 🫢 you should only use this if the command produces no more than 8 KiB of output. the limit on how much data a FIFO can buffer varies with the OS but is typically 8 KiB, 16 KiB or 64 KiB. and if you use this option and the command on the left of the psub pipeline produces more output, a deadlock is likely to occur πŸ’€ like, actually. be careful.
⚠️ bestie i'm serious about that -F one. deadlock is not a vibe. it's not flirty, it's not cute, it's a hang. πŸ’€
  • -s, --suffix _SUFFIX_ β€” append _SUFFIX_ to the filename. cute little name tag πŸŽ€
  • -h, --help β€” displays help about using this command. the classic. the icon. the one we all press first πŸ™ˆ

🌸 EXAMPLE 🌸

this is where it gets good. look at these:

diff (sort a.txt | psub) (sort b.txt | psub)
# shows the difference between the sorted versions of files ``a.txt`` and ``b.txt``.

source-highlight -f esc (cpp main.c | psub -f -s .c)
# highlights ``main.c`` after preprocessing as a C source.

the way that first one shows the difference between the sorted versions of files a.txt and b.txt?? literally ate. πŸ”₯ and the second one highlights main.c after preprocessing as a C source β€” note the -f and -s .c combo, that's the whole trick right there. chef's kiss πŸ‘‘


fish-shell developers. respect the devs, they made the shell and the fish, periodt. πŸ’œ


okay so that's the page!! 🌈 this was fish-shell version 4.9, dated Sep 08, 2026 β€” so mark your calendar, screenshot it, put it in the group chat, because that's the tea. now go forth and psub responsibly, bestie πŸ«Άβœ¨πŸ’–

πŸ“¦ where this page comes from
  • arch rolling: fish 4.9.3-1 Β· GPL-2.0-only AND BSD-3-Clause AND ISC AND MIT AND PSF-2.0
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms