|
|
|
|
|
by serious_angel
18 hours ago
|
|
For example, the following "works": json='{ "left":2, "right":2 }';
result="$(
perl -e '($_)=<>; / "left":(\d+), "right":(\d+)/; print $1 + $2, "\n";' <<< "$json";
)";
printf '%s\n' "$result";
Yet, it is literally the same as: printf '%s\n' "$(( 2 + 2 ))";
|
|