2 ms·
> if anybody is using an alternative shell as a daily driver and getting considerably more out of it? I wrote my own. Originally motivated by the fact that bas
by a1369209993 5y ago
> if anybody is using an alternative shell as a daily driver and getting considerably more out of it?
I wrote my own. Originally motivated by the fact that bash doesn't handle `$VARWITHSPACES` correctly (if I want expansion, I can write `$@VARWITHSPACES`), but I get a surprising amount of mileage out of random features shoved into corners of the substitution syntax like:
$ factor $@m/[0-9]+/$[(1<<15)-((2*$0)-1)]/q'1 2 3'
32767: 7 31 151
32765: 5 6553
32763: 3 67 163
(`$q''` produces a string, `$@m/regex/pat/` finds matches in it and expands `"pat"` for each with $0,$1,... set to captures, and $[expr] evaluates match expressions.)
- a1369209993 5y ago> and $[expr] evaluates match expressions. Math. It evaluates math expressions. (I already had the logic handy since `${...}ARRAY` needs it to pick out a element of `$@ARRAY`.)