[TUHS] A few comments on porting the Bourne shell

Adam Thornton athornton at gmail.com
Tue Jan 3 06:05:37 AEST 2023



> On Jan 2, 2023, at 12:50 PM, Warner Losh <imp at bsdimp.com> wrote:
> 
> 
> You can get super close though, but I'll bet there's some scripts that work only because they didn't run on, say, Eunice...

"Congratulations!"

> 
> But luck favors the prepared... and making the effort to try to be portable will help when you have to run on dash, or one of the BSD shells that might not have $<(cmd) or some other useful but not universal feature...

Yeah and I think we're basically agreeing here.  The problem isn't *really* whether you use some-odd-number-of-backslashes-and-a-backtick versus dollar-open-paren, the problem is people who put #!/bin/sh at the top of the script when the contents only run under bash.  And there's a lot of that, because just as all the world was VAX once upon a time, all the world is assumed to be an x86_64 Linux where sh is bash.

At least the move towards containerization has largely defeated that assumption now, although in some sense it's also just swept the problem under someone else's rug.

Adam



More information about the TUHS mailing list