News for hackers. Stuff that matters.
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 :)
Re:What's New in POSIX 2024 by tetha on Tuesday October 29, 2024 @07:55AM (#41982947)
I do enjoy "ls *; touch -- -lisah; ls *" as a fun little brainteaser for those uninitiated to this behavior.
Re:What's New in POSIX 2024 by redserk on Tuesday October 29, 2024 @07:24AM (#41982734)
If one really wanted to embrace chaos, introduce this as a new team file naming standard for "risk finding" files ;)
Re:What's New in POSIX 2024 by ykonstant on Tuesday October 29, 2024 @09:22AM (#41983602)
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.

Re:What's New in POSIX 2024 by nneonneo on Tuesday October 29, 2024 @10:12AM (#41984014)
export TMPDIR=" / "

to surprise the next person or script to do "rm -rf $TMPDIR/foo"...