FatPhil | I've forgotten the argument against "x$var" now, but I never found the one I heard convincing enough to shake me out of the pattern that I've been using for well over 3 decades. I think it was simply "it's unnecessary, as you can achieve the same outcome other ways". Those other ways were more verbose. | 13:50 |
---|---|---|
FatPhil | "Idiom", or "smell" is I guess the question. But blue cheese wouldn't be good blue cheese if it didn't come with some smell. | 13:53 |
onefang | Smell is in the nose of the beholder. | 14:03 |
sixwheeledbeast | no excuse for bash | 14:09 |
sixwheeledbeast | should be using [[ not test | 14:09 |
sixwheeledbeast | https://www.shellcheck.net/wiki/SC2268 | 14:18 |
FatPhil | one site that says 'don't use x"$s"' also says 'don't use [[' ... | 14:38 |
FatPhil | I dislike [[ because it puts the rest of the line in a completely different parsing context from what it superficially seems to be. It's more like a quoting context. | 14:40 |
FatPhil | some might say that test is best as it's obviously a command, not just an element of syntax | 14:41 |
FatPhil | the trailing ']' for [ is clearly "smell" amirite? | 14:43 |
FatPhil | sixwheeledbeast: "If you are targeting especially old shells, you can ignore this warning". The shell on my phone, which I program to be portable for, dates back to 2009. And I ain't giving up this phone any time soon - I took delivery of 3 more bodies just last week, that should last my g/f & I for another 5 years. | 14:54 |
sixwheeledbeast | [[ is a keyword and "should" be used where available. it protects [ is a synonym for test. n900 default is busybox anyway so who knows what mess... I have bash4 from extras. | 14:56 |
sixwheeledbeast | it appears to have [[ but no printf ... what a surprise #messybox | 15:00 |
sixwheeledbeast | printf is an alias to elsewhere... | 15:01 |
FatPhil | other opinions are available: https://github.com/anordal/shellharden/blob/master/how_to_do_things_safely_in_bash.md#should-i-use-double-brackets | 15:01 |
sokan | I want a fast and easy installation (instead of arch/artix/gentoo/etc). netinstall has me covered? | 21:03 |
rwp | sokan, Devuan Chimaera Install Guide (with screenshots) https://www.devuan.org/os/documentation/install-guides/chimaera/install-devuan | 21:07 |
sokan | rwp: ty :) | 21:10 |
Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!