From https://www.etalabs.net/sh_tricks.html
They're right. I suffered to expand macros, reproduce binaries, and write cross-referenced documents of any format (akin to an interpreted flat assembler g with its own typesetter). This result uses no more than the common behaviors of built-in utilities found in ash, bash, dash, ksh, ksh93, yash, and zsh. I exclude mksh because the bottleneck I can't optimize (looping over bytes in a variable) slows mksh to a crawl. Portable code is already slow enough.It is my hope that these tricks serve to show that is IS possible to write correct, robust programs using the plain POSIX shell, despite common pitfalls, but also that the lengths needed to do so are often extremely perverse and inefficient.
I tested and "normalized" shells in the same way that a CSS+JS author normalizes supported browsers. I'm strict about the lean dependency profile: no compilers, no assemblers, no external "build system." Not even mkdir, cat, sed, or other "mandatory" utilities are required. Everything hinges on built-ins from the oldest POSIX XCU volume I can support, and that needs to be enough to generate a FAT32 volume containing a UEFI+IA-64 application and its manual. That application need not be an OS, hence me posting in this forum.
Why care this much?
So I and this community need fewer licenses to practice system dev concepts on a whim, without needing to install anything. Just grab the shell you happen to trust on the system you happen to have, along with any specs needed for a target environment. Then use Arcane to support a one-liner like
Code: Select all
% \sh mkimg | \dd bs=4K of="${of?}" # of=/dev/... Where's the code?
In private storage. I spent WAY too much time to publish it in view of scrapers and LLMs, and my name is all over the work. Normally I'd lead with the code, but I ask you DM me to negotiate mutual authentication and exchange public keys. We'll sign a bill of materials and a license, then I'll distribute Arcane to you privately. Depending on the terms, the license might be free. For those able and willing to pay, I'll work towards adding support for your device to the extent that I can.