On Sat, Apr 19, 2025 at 08:05:54PM +0800, Sean Whitton wrote:
I have interpreted scripts that I want to run on any FreeBSD and Debian machine, because they are part of my OS bootstrapping. What else is there than POSIX sh for this? Therefore, it's still relevant.
With that requirement, what you really want to know is how to write a script that works on FreeBSD and Debian--which POSIX can't tell you. (Neither of those is POSIX certified or fully compliant.) POSIX might be a starting point, but you'll have to read man pages and figure out the discrepencies. If you're stuck doing that anyway, I seriously question the value of artificially limiting yourself to what unix tools did 30 or 40 years ago--newer tools or options often let you accomplish tasks much more efficiently. Maybe it would be worth avoiding those if POSIX really did let you write once and run anywhere...but it doesn't.