wrote a pipeline at work that went approximately thingctl blah list --json | jq -r '.items[] | @text "thingctl blah blah --bluh=\(.bluh) --ble=\(.blem)" | sh
-
wrote a pipeline at work that went approximately
thingctl blah list --json | jq -r '.items[] | @text "thingctl blah blah --bluh=\(.bluh) --ble=\(.blem)" | sh
-
mx alex tax1a - 2020 (4)replied to mx alex tax1a - 2020 (4) last edited by
the
| sh
was considered spicy -
@atax1a turning my | shs into . <(s to evade suspicion... thats girl ma^Wprogramming
-
@nabijaczleweli that would have been even more spooky to them
-
Mattias Wadmanreplied to mx alex tax1a - 2020 (4) last edited by
@atax1a @nabijaczleweli tip: use @sh to shell escape while string interpolate:
$ jq -rn '"a b c" | @sh "hello \(.)"'
hello 'a b c' -
mx alex tax1a - 2020 (4)replied to Mattias Wadman last edited by
@wader unnecessary in this case due to the data we were handling
-
mx alex tax1a - 2020 (4)replied to mx alex tax1a - 2020 (4) last edited by
we picked up this technique indirectly (possibly apocryphally) from larry wall via one of the system programmers at our university, a guy called
schlake
, who said that the best perl oneliner he'd ever seen was one in which larry wall did the same thing, and commented it "Bet ya weren't expecting that".
Copyright © 2024 NodeBB | Contributors