3 ms·
You mean shellcheck will detect when single brackets won't be enough? I've also just defaulted to double because I never really looked into it
by duskdozer 10mo ago
You mean shellcheck will detect when single brackets won't be enough? I've also just defaulted to double because I never really looked into it
- stabbles 10mo agoYeah, if you set the shebang `#!/bin/sh` (which is portable), shellcheck will complain about double brackets. It also helps you do quoting correctly when using single brackets.
- duskdozer 10mo agoI see. I've always just used `#!/usr/env/bin bash`. I wonder if there's a directive to hint at incompatibilities without changing it? I'll have to see. And this isn't meant snarkily - why should I care if my scripts are portable? I've worked on a number of different devices and types but have seemingly always had access to bash.