4 ms·
Tools like rg offer additional features and/or save you from tediously specifying many options. This one gives you -f for free, that’s about it. Detailed compar
by oefrha 6y ago
Tools like rg offer additional features and/or save you from tediously specifying many options. This one gives you -f for free, that’s about it. Detailed comparison: https://news.ycombinator.com/edit?id=23445931 https://news.ycombinator.com/edit?id=23445931
- BiteCode_dev 6y ago- it supports regex separators. That's a great feature to me. - the default separator is "\s", like python's split(). Just for that I will adopt it: not having to care about tabs/spaces/mixes is a much better experience. - it has negative indexes, again like python. Getting the last field, or the last nth field, is something common enought. I don't want to rewrite the thing with a twisted double "rev" with proper index. And I don't want to have to google it. - plus the syntax is just must easier to remember to me. When I use cut, I always try: "echo 'foo bar baz' | cut 2", just to realize that I need to pass '-f', then I do "cut -f 2", and get stump, and google it, to then remember I need to pass the delimiter explicitly even if it's a space. - it works the same on windows. I dual boot. Compare: echo -e "foo bar baz" | choose -1 To: echo -e "foo bar baz" | rev | cut -d ' ' -f 1 | rev cut is, to me, the opposite of a friendly API. Something so basic in the Unix world should have sane default. Default are not sane if I have to google it once out of two.
- masklinn 6y agoOne more great feature of choose which cut doesn't have: not returning garbage output on garbage input. If you give cut columns which don't exist, it's going to output the entire source as-is.