4 ms·
I generally agree with your sentiment here, but be careful with assuming bash==bash There are differences between versions. I can't even remember what they are
by dijit 6y ago
I generally agree with your sentiment here, but be careful with assuming bash==bash
There are differences between versions. I can't even remember what they are off the top of my head like I used to, which makes them all the more aggravating to discover again.
But I would recommend sticking to a subset of bash, not any of the new fancy features like 'globstar' which allows recursively globbing.
There are tools to manage these kinds of tests, like bashenv. But you're in the same problem scope at that point.
- moreaccountspls 6y agoThat's why I said "Posix shell" and not bash.
- GolDDranks 6y agoI much agree with the sister comment and I write my shells for /bin/sh also. There is this wonderful tool called ShellCheck ( https://www.shellcheck.net/ https://www.shellcheck.net/ ) that checks that your script is actually POSIX-compliant if it starts with #!/bin/sh