logoalt Hacker News

serious_angeltoday at 2:13 AM0 repliesview on HN

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 ))";