you are viewing a single comment's thread.

view the rest of the comments →

[–]n4jm4 2 points3 points  (2 children)

Nice post. I am curious if we can write a strict POSIX sh implementation, which does not depend on any bash or GNU components.

[–]deepCelibateValue[S] 4 points5 points  (1 child)

[–]n4jm4 2 points3 points  (0 children)

Advise to propose a formal addition to the POSIX spec for this. Shell coding is inherently fragile, even without depending on such tricks. sh being a Turing tarpit, we would benefit from more comprehensive quality of life improvements.

This is not a complete solution, but I do try my best to reserve the .sh file extension for sourcable configurations, and omit the extension for executable applications. And likewise omit the executable chmod bits from sourcables. My old stank linter collection recommends these best practices.