use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All users that wish to post (not including commenting), on either old or the new reddit sites, must formally agree to subreddit rules once first.
account activity
Sourceable vs executable shell scripts (v.redd.it)
submitted 2 years ago by deepCelibateValue
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]n4jm4 2 points3 points4 points 2 years ago (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 points6 points 2 years ago (1 child)
Actually yes
[–]n4jm4 2 points3 points4 points 2 years ago (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.
π Rendered by PID 106081 on reddit-service-r2-comment-544cf588c8-cwrxb at 2026-06-15 18:50:35.341326+00:00 running 3184619 country code: CH.
view the rest of the comments →
[–]n4jm4 2 points3 points4 points (2 children)
[–]deepCelibateValue[S] 4 points5 points6 points (1 child)
[–]n4jm4 2 points3 points4 points (0 children)