YEXPAND(1)

πŸ“¦ version 2025.09.18.4, in nixos 26.05, nixpkgs unstable

πŸ’… yexpand(1) β€” General Commands Manual πŸŽ€

okay bestie, welcome to the yexpand(1) page, straight out of the General Commands Manual ✨


🌸 NAME 🌸

yexpand β€” a tool to expand environment variables in Nypatchy cradles 🧚


⭐ SYNOPSIS ⭐

yexpand inputfile [ outputfile ]

πŸ’– DESCRIPTION πŸ’–

so yexpand is, and I cannot stress this enough, a very simple script πŸ”₯ its whole job is to expand environment variables inside a text file into their current values from the shell environment. that's it, that's the gig πŸ’…

it was written to be used with nypatchy cradles, periodt. and honestly? the author is literally begging you: do not try to use it for anything else πŸ‘‘ (go look at BUGS below, it's giving cautionary tale 😭).


πŸ¦‹ USAGE πŸ¦‹

okay so here's the whole vibe:

  • yexpand takes inputfile as input πŸ“₯
  • it replaces all instances of shell variables β€” written in the form $VARIABLE or ${VARIABLE} β€” with their current values in the environment 🌈
  • and it saves the result to outputfile πŸ’Ύ
  • undefined variables? they get replaced with the empty string, no questions asked πŸ’€
  • if outputfile isn't given, the result gets saved to the current directory instead, as a file with the same name as inputfile πŸ™ˆ
  • which means... an input file sitting in the current directory will be overwritten 😭
like, actually overwritten. main character energy but make it destructive 🫢

πŸ’€ BUGS πŸ’€

bestie. buckle up. this script is very simple-minded 🧠✨

since it basically just echoes its input file as a here-doc, it will attempt to perform all types of shell substitution (command substitution, etc.) β€” not just variable substitution πŸ”₯ so yeah, it's likely to fail on anything except the very simplest text files πŸ’… ngl that's a whole mood.

additionally, this script creates a temporary file πŸ“„ the file is created in the current directory, so there should not be security implications 🌸 but heads up: any existing file named file.yexp (where file is the basename of inputfile) in the current directory will be overwritten and then deleted πŸ˜­πŸ’€

fr fr, check your directory before you run this, i'm literally begging πŸ™

πŸ‘‘ SEE ALSO πŸ‘‘

fcasplit(1), nycheck(1), nydiff(1), nyindex(1), nylist(1), nymerge(1), nypatchy(1), nyshell(1), nysynopt(1), nytidy(1)

the reference manual for the Nypatchy suite of programs is available in compressed PostScript format at the following URL:

http://wwwasdoc.web.cern.ch/wwwasdoc/psdir/p5refman.ps.gz

πŸŽ€ AUTHOR πŸŽ€

this manual page was written by Kevin McCarty <kmccarty@debian.org> for the Debian GNU/Linux system (but may be used by others) 🫢 it is licensed under the GNU General Public License, version 2 or later (at your choice) ⭐


Copyright (C) Kevin B. McCarty, 2008.


and that's the whole page, bestie ✨ written up and dated Mar 12, 2008 β€” iconic, timeless, lowkey legendary πŸ’œ πŸ¦‹

πŸ“¦ where this page comes from