I get this on Unix, where the pissweak tooling is a disaster, but as a user, I own the file name. If I can’t use every character I want to, that’s a total fail on the part of the platform.
I agree that you own the filename and should be able to use any characters you want, but there has to be some trade off regarding what filenames you can use in a comfortable manner and which require some form of escaping/quoting.
Another weird character would be the tilde (~). Technically a valid character in a filename, but whenever I see one I begin to fear that I might delete or mess with my home folder.
The tilde is a perfectly fine character to use in a filename, it’s just the shell that does the expansion to your home directory if you give “~ “ (or “ ~ /” at the start of a path). My preferred editor marks the backup file with “~” (at the end of the filename).
Edit: ~ is a “special” Markdown character. No comment on that.
I mean, I don’t use spaces, or tildes, or dollar signs (or colons, for HFS+) in any files that I create or expect to manipulate on the command line, but that doesn’t mean it’s OK. I want the compromises that my computer and I make to live with one another to be largely the province of the computer.
Unlike on other operating systems (well, file systems to be precise), you actually can use any character - even newline or NULL if you so wish. The problem is that you also have to use something as a separator - it so happens that a blank is a natural way to split words apart :^)
So yes, you have to escape or quote blanks and other characters which are extra special ;^)
Or just use spaces and escape them? It’s not hard, and escaping occurs literally everywhere strings are used.
zsh tab completion auto-escapes. GUI programs don’t need to worry about it. I have plenty of filenames with spaces in them, and they don’t cause problems for me.
How about not using spaces in filenames in the first place?
I get this on Unix, where the pissweak tooling is a disaster, but as a user, I own the file name. If I can’t use every character I want to, that’s a total fail on the part of the platform.
I agree that you own the filename and should be able to use any characters you want, but there has to be some trade off regarding what filenames you can use in a comfortable manner and which require some form of escaping/quoting.
Another weird character would be the tilde (
~). Technically a valid character in a filename, but whenever I see one I begin to fear that I might delete or mess with my home folder.The tilde is a perfectly fine character to use in a filename, it’s just the shell that does the expansion to your home directory if you give “~ “ (or “ ~ /” at the start of a path). My preferred editor marks the backup file with “~” (at the end of the filename).
Edit: ~ is a “special” Markdown character. No comment on that.
I mean, I don’t use spaces, or tildes, or dollar signs (or colons, for HFS+) in any files that I create or expect to manipulate on the command line, but that doesn’t mean it’s OK. I want the compromises that my computer and I make to live with one another to be largely the province of the computer.
You can say that about other characters, too -
*,;,?, etc. not just~.If in doubt, quote or escape :^)
Unlike on other operating systems (well, file systems to be precise), you actually can use any character - even newline or NULL if you so wish. The problem is that you also have to use something as a separator - it so happens that a blank is a natural way to split words apart :^)
So yes, you have to escape or quote blanks and other characters which are extra special ;^)
Obviously not Null :^P - I was thinking of Null as used by
find ... -print0andxargs -0. I should probably get some sleep ;^)Or just use spaces and escape them? It’s not hard, and escaping occurs literally everywhere strings are used.
zshtab completion auto-escapes. GUI programs don’t need to worry about it. I have plenty of filenames with spaces in them, and they don’t cause problems for me.