Hacker News new | ask | show | jobs
by mcclung 2096 days ago
I patch that behavior out of the GNU core utils on my Gentoo machines, and set the quoting style properly everywhere else.

This is one of the worst behavior changes ever to come out of GNU. It should never have been the default.

1 comments

As someone who actually likes the new behaviour[+] would you mind elaborating why you dislike it so much? The only case I can think of is copying filenames into a GUI or something which doesn't support escaped paths, but the previous behaviour wasn't much better because you couldn't be sure what the full filename was.

[+]: Imho it makes it easier to copy-paste paths (sometimes I need to , as well as spot whitespace / strange characters in filenames.

It's not about liking the behaviour, it's about the usual UNIX nonsense of arbitrary breaking decisions being made on the hoof for whimsical reasons - everywhere. Because no one cares enough to cooperate with others on these things outside of their own little sandpit.

Path handing is an important feature. It should be standardised and predictable. It doesn't even matter how it's standardised. What matters is that everyone uses the same system so there are no random surprises or thwarted expectations.

In a robust OS everything would be a lot more interoperable and standardised than it is in UNIX. Being able to pipe things around is not the killer feature it might be - not if you have to waste time pre/post translating everything for arbitrary reasons before you can do anything useful with it.

The main way you'd be interoperating with ls is through pipelines, and GNU ls doesn't do any pretty-printing of paths when used in a pipeline (besides, arguably the correct way of handling paths that may have newlines or spaces embedded is with `find -print0` but that's a whole different topic). Or is there some other aspect of interoperability you're referring to?

But if we're being honest, path handling (as well as structured data) in shell scripts and pipelines has always been of the largest trash-fires in Unix -- while I don't personally like how Powershell solved the problem on Windows at least they tried to solve it.

If you use open source software long enough, you will eventually be disappointed in a design decision. In this case, it was a big surprise when a tool I'd been using since the early 1990s suddenly changed its output with absolutely no warning. This is both an expected result from using Gentoo, and simultaneously very disappointing.

I don't think I was the only person unhappy with this. The fact that https://www.gnu.org/software/coreutils/quotes.html exists seems to indicate that others feel as I do.

Furthermore, I was disappointed by the reaction from both the developers and other people leaping to their defense who felt that they'd been personally insulted by users suggesting that this may have been better as a non-default option. If I can set QUOTING_STYLE=literal everywhere, surely the distro maintainers who wanted this could have set QUOTING_STYLE=shell-escape?

I'd be the first to say that everyone is free to disagree with me. I have the source, I have a workaround, I adapt.

I have been disappointed in FOSS design decisions before, but I've also been on the other side of such decisions as a maintainer -- and it's often the case that users aren't aware of all of the trade-offs that go into making "obvious" decisions. I try to be more understanding these days as a result -- yes, sometimes maintainers are wrong but all things being equal they probably know better than you or I what the right decision is.

For instance, one could argue that hiding the behaviour behind a flag makes the feature effectively useless (users that would benefit most from it would never know about the flag, and users who know enough to find the flag probably know about `find -print0` too). Punting the problem to distributions just means that everyone who is against the feature on general principle will now hound distributions for making the change (probably making arguments like "why are you making yourself incompatible with Debian X or Ubuntu Y.Z?") -- and will also result in the feature being unused and thus useless.

Now, is that enough of a reason to make a change to the default behaviour? I don't know, but to me it doesn't seem as though the right decision was "obvious". And again, the behaviour is only different when the output is displayed on an interactive terminal -- so the only breakage is the interface between the screen and your eyes.