4 ms·
I always use "test" and never "[" (and I've only used "[[" once when I thought I needed a builtin regex matcher for efficiency). Partly because fish does the s
by waterhouse 6y ago
I always use "test" and never "[" (and I've only used "[[" once when I thought I needed a builtin regex matcher for efficiency). Partly because fish does the same, partly because despite writing bash scripts for years I do not want to have the "[ vs [[" information in my brain (nor should whoever reads my code).
(For similar reasons, whenever I'm grepping for a nontrivial regex, I always use egrep rather than grep, because the escaping semantics are simpler—"if it's escaped with a \, then it's not special"—and again I do not want to have the information of "which characters are special only when escaped in base grep" in my brain.)
- boogies 6y ago> I do not want to have the information of "which characters are special only when escaped in base grep" in my brain Tangential but relevant to the Edit thread today were vis was mentioned, “No more {very-,}{no,}magic modes with different semantics and escaping rules. Instead we use the familiar and predictable POSIX Extended Regular Expression variant.”¹ is a real advantage over vim. ¹https://github.com/martanne/vis/wiki/Differences-from-Vi(m)#posix-extended-regular-expressions-instead-of-a-custom-non-standard-variation https://github.com/martanne/vis/wiki/Differences-from-Vi(m)#...