Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    jq 'reduce .[] as $obj ({}; .+$obj)'
or

    jq -s 'reduce .[] as $obj ({}; .+$obj)'
should do it. `+` adds objects by merging them.


Thanks! I'm eager to try this and hopefully clean up my code!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: