Re:What's New in POSIX 2024
by nasretdinov on Tuesday October 29, 2024 @05:58AM
(#41981808)
The thing is, it's hard to predict what would happen to those scripts regardless... E.g. try naming your files "-rf" and see how many things break :)
[ Parent
| on HN ]
I do enjoy "ls *; touch -- -lisah; ls *" as a fun little brainteaser for those uninitiated to this behavior.
If one really wanted to embrace chaos, introduce this as a new team file naming standard for "risk finding" files ;)
A correct script will have no problems with "-rf" or any other file name. I have (and recommend script writers make their own) a directory hierarchy of "dangerous" file names to test scripts.
For example, it contains a directory where all file and subdirectory names are in unary, consisting only of repetitions of the newline character. A correct script should be able to enumerate, access and modify files in there without issue.