News for hackers. Stuff that matters.
Re:If you use GNU grep on text files, use the -a (--text) op... by wruza on Tuesday April 21, 2020 @11:50PM (#22941924)
”The old behavior was the bad one; the new behavior is good”

If you’re a human, yes. If you’re a script, it breaks you in half. If you’re a script that has to run on various versions, then maybe it’s time fix yourself and use find. You’re a sophisticated script after all, not one of these who require a human with a debugger. Modern culture may not appreciate that little ‘compat’ thing, but it is essential if you want something to continue to work and not just stop and wait for someone’s educated guesses. Good software doesn’t point fingers at you, it just works. I remember how recently I wanted to check network interfaces on some machine and commanded ‘ifconfig’. Now it’s called ‘ip a’, and there is no ifconfig. I can guess the reason – ifconfig was bad and ip is good. There is also an eternal “FAT” label issue in unetbootin app, which resurrects every time Apple changes its fdisk output format (in every release, as it seems). The workaround is to run it with a cli option – a very thing that unetbootin was created for to skip. This is what makes systems so much fun. Without all these cool things, we would just sit there and cry over our uselessness.

ed: I read below that ls does that in interactive mode only, maybe it’s not that bad then.

Re:If you use GNU grep on text files, use the -a (--text) op... by int_19h on Wednesday April 22, 2020 @04:21AM (#22943359)
You can't just expect compatibility about random things - that's why we have formal contracts: standards, specifications, documentation. A human-readable output of any app, in particular, should never be assumed to be stable, or to have a specific format (even if observations imply it), unless its docs specifically say otherwise.
Re:If you use GNU grep on text files, use the -a (--text) op... by foldr on Wednesday April 22, 2020 @03:28AM (#22943109)
A script will see the old-style output. The new-style output is tty only
Re:If you use GNU grep on text files, use the -a (--text) op... by steerablesafe on Wednesday April 22, 2020 @03:17AM (#22943050)
Hats off if your script used ls and handled weird characters in filenames just fine.