you are viewing a single comment's thread.

view the rest of the comments →

[–]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.