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

> Try doing THAT with any other CLI one-liner!

Challenge accepted.

    cat earthporn.json | \
    jshon -e data -e children -a -e data -e title -u | \
    sed -r 's/\<./\U&/g' | tr -d ' ' | sed 's/[^a-zA-Z].*//g`
I'll stick with Jshon for my routers and other little ARM devices.

But this utility is pretty nifty. Personally the whole select thing feels a little too magic for my taste, but when it works it looks quite compact. I'll probably be borrowing that colorizing feature tomorrow. And thanks for the link at the bottom :-)



Nice to see tr getting some use, though given the sed on either side I wonder if

    sed -r 's/\<./\U&/g; s/ +//g; s/[^a-zA-Z].*//'
would be better. Note, the last s/// doesn't need a g.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

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

Search: