Comment by chrisseaton

4 years ago

> And shells and other programs still have problems with perfectly legal characters in filenames too, like '!' or ':'.

Without asking you to always quote and escape every file name - what alternative is there? If they tried this you'd probably find you didn't like it.

Not exactly - the problem is mostly when doing variable expansion. The fact that bash treats "$x" and $x as different is a bit of a design flaw. Of course there's still an issue with evaluating dynamically generated code, but that problem is partly solved by working with arrays.

  • I mean how do you want shells to deal with file names with spaces in? Do you think we should have to quote and escape all file names all the time? If not then how do you think it should work?

    • Shells should treat data as data, and not have the default behaviour be treating it as code (i.e. you should need to do 'eval $x' or some equivilant if you acutally want the string to be treated as a shell command). This would also mean having a real list type, instead of depending on arbitrary seperators in strings. This is exactly how other languages treat it, and it is not a significant challenge for interactive use (in fact, it would substantially reduce the opportunity for suprises when running commands interactively as well).