News for hackers. Stuff that matters.
Re:The tale of aux.c by YSFEJ4SWJUVU6 on Tuesday September 26, 2017 @10:48AM (#15339122)
While GNU's not unix... afaik GNU coreutils' rm has done exactly what you expect it to when given a single dash as an argument for who knows how long.

The problem is names that could be interpreted like options, like '-f' or '--help'.

Re:The tale of aux.c by mort96 on Tuesday September 26, 2017 @04:21PM (#15342184)
Interestingly, when the shell expands * , it won't do anything to make sure files starting with - are handled properly.

This means, if you're in a directory with the files a, b, -rf, and the directories foo/ and bar/, running "rm * " will not delete all the files and keep all the directories; instead it will be turned into "rm a b bar foo -rf", meaning it will delete all the files and directories except for the file -rf.

Re:The tale of aux.c by xelxebar on Wednesday September 27, 2017 @01:43AM (#15345195)
I've definitely run into this on bash and zsh (iirc). I'm curious if this glob expansion behaviour is set in posix somewhere.