Hacker News new | ask | show | jobs
by kseistrup 1470 days ago
The biggest handicap of cut for me has always been that it cannot split on blanks (TABs or SPACEs), you have to choose between TAB or SPACE. So I wrote an awk script that can print field ranges like cut, but recognizes blanks. Now I will see if I can get tuc worked into my muscle memory.
1 comments

I usually just pipe through sed to normalize the separators before applying cut.
That's also a little awkward, when there could easily be an option to split by all blanks.
I’m not defending cut here, but using sed is also pretty straightforward and fits its purpose. I’d argue that using the existing general-purpose tools is better than creating custom narrow-purpose tools in simple cases like this one. Besides maintainability and familiarity, it also exercises your proficiency in applying the standard tools.
You have a point, of course.