Wheeler: Fixing Unix/Linux/POSIX Filenames
Wheeler: Fixing Unix/Linux/POSIX Filenames
Posted Mar 26, 2009 1:12 UTC (Thu) by mrshiny (guest, #4266)In reply to: Wheeler: Fixing Unix/Linux/POSIX Filenames by emk
Parent article: Wheeler: Fixing Unix/Linux/POSIX Filenames
I was actually referring to the other special characters that cause problems, such as shell control characters. The dash is a different case because it's actually the programs (not the shell) that are interpreting certain strings as filenames and others as arguments. There can't really be a generic solution to this because of the way file globbing works: the globbing happens outside the program so it has no input into the command line that is passed in. If filenames can't start with a dash, but a command was ported from DOS and uses backslash as its option separator, shell globbing will confuse that program too.
Not that preventing files like '-rf' isn't a bad idea. I think it would prevent a number of mistakes.
