Bash scripts; use double brackets, fix bare variables, add quotes#38424
Bash scripts; use double brackets, fix bare variables, add quotes#38424vdemeester merged 1 commit intomoby:masterfrom
Conversation
These scripts explicitly use Bash, so we should be able to use `[[` instead of `[` (which seems to be recommended). Also added curly brackets to some bare variables, and quoted some paths. This makes my IDE a bit more silent :-) Signed-off-by: Sebastiaan van Stijn <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #38424 +/- ##
=========================================
Coverage ? 36.55%
=========================================
Files ? 608
Lines ? 45036
Branches ? 0
=========================================
Hits ? 16465
Misses ? 26293
Partials ? 2278 |
1 similar comment
Codecov Report
@@ Coverage Diff @@
## master #38424 +/- ##
=========================================
Coverage ? 36.55%
=========================================
Files ? 608
Lines ? 45036
Branches ? 0
=========================================
Hits ? 16465
Misses ? 26293
Partials ? 2278 |
|
Ah, wish I'd dug in and seen this sooner. 😞 (Sorry!) See https://serverfault.com/a/705144 for a great (very extensive) post which outlines some of my own thoughts on this topic. |
We use this script via /bin/sh because it hasn't had any Bashisms lately (until moby/moby#38424), so we need to stop updating (at least for now).
|
@tianon want me to revert the double-bracket changes? I know we tried to avoid Bashisms in the past, but I noticed these files used |
|
I would certainly appreciate the double brackets going away 😅 In the |
These scripts explicitly use Bash, so we should be able to use
[[instead of[(which seems to be recommended).Also added curly brackets to some bare variables, and quoted some paths.
This makes my IDE a bit more silent :-)