1. naming things
2. cache coherency
3. off-by-one errors
???
4. quoting pathnames
> dir c:\progra~1
So if forcing people to handle spaces was the goal, it took a long time to force it.
While we cannot avoid that people hit the spacebar when writing a filename on a gui, this does not mean at all that the resulting filename itself need contain a plain space character. Those spaces can and should be transparently translated to non-breaking space characters at some point. Maybe by the gui itself, or more robustly by the filesystem. This would make everybody happy: gui users and naive shell script writers.
Why? This just introduces more complexity and interoperability headaches for seemingly no reason.
In order to preserve the sacrosanct simplicity of naive shell scripts. Seems like a very noble goal to me.
The only unexpexted compexity arises when you want to deal with filenames having mixed spaces and nbsps. But I'd say that people who do that had it coming.
The filesystem is way more important than /bin/sh and and any complexity added there will trickle down to all programs, not just shell scripts.
It's not worth adding hacks on the FS to patch defects in poorly written shell scripts (which are being replaced en masse with python/nodejs/even weirder yaml files/systemd units/etc... anyways)
To mishandle spaces you have to split an input w/ filenames by whitespace, which is not that common of an operation outside of a shell.
If you actually test this, you'll realize a ton of Windows programs get it wrong.
Also, in general this is a poor argument. The goal of Linux isn't to be as much like Windows as possible, because Windows sucks ass. Nobody in their right mind would use Linux if it was just Windows but, presumably, shittier. The entire appeal of Linux is that it isn't Windows, and it isn't MacOS.
Even zsh has fixed this. It's just /bin/sh and bash that are annoying.
sh-3.2$ f='Hello world'
sh-3.2$ echo $f
Hello world
sh-3.2$ for i in $f; do echo $i; done
Hello
world
sh-3.2$ f='Hello\xC2\xA0world'
sh-3.2$ echo $f
Hello world
sh-3.2$ for i in $f; do echo $i; done
Hello world sh-3.2$ f='Hello world'
sh-3.2$ echo "${f}"
Hello world
sh-3.2$ for i in "${f}"; do echo "${i}"; done
Hello world
sh-3.2$If I had it, I would use it today.