@tost it's certainly a way to not write a long-sed-pattern (see above: pls don't print the other non-replaced lines + pls capture this thing + pls insert escape sequence + pls have ID and ID_FAMILY)
and is a good way to make your one "more robust" in the case that another 'debian' words appeared other than ID/IDFAM lines, u have to repeat the pattern a bit but is also nice and with more rigour :shibaheart:
@tost this is very sensible yes, i generally put doubles because sometimes variables get tossed into another variable’s values at a later time, but if you’re strict with the quoting you know you will only get literals and not variable expansions so you reduce the places where to look into for debugging..
where you should also use $’’
yes, i had to do this $'' when i was defining LESS_TERMCAP for coloring it (export LESS_TERMCAP_mb=$'\e[1;31m'); the other route was to use command substitution with $(printf <escape>) (becuse apparently $'' is not defined by POSIX or so shellcheck says
finally, there’s the cursed route of using $(tput <something>) i’ve seen it in the wild but i know tput is way slower than printf escapes so i was wary of using it
@helene@tost oh that's very interesting explanation thanks, im happy you're sharing your experience with me <3
i've never used erlang/elixir (im not a programmer) and found Rust curious because how painstaking i was finding to debug memory // ensure memory is correct in C programs u need to do it by hand/brain basically and Rust does it for u
but i've only written my first C smol program recently and i haven't written anything in rust yet..
how case(1b) functions
apparently shellcheck people didn’t catch it :hehecat:
im not sure what POSIX says on case’s patterns behavior, i’ll have to read
btw i didn’t find info about the desync pattern thing
some shells have unqualified entries work as wildcards or terminators and it’s wild
you should generally presume them to be “flat” strings
icic thx lots for the explaining and all your time tonight <3 u always make me learn and i feel grateful