3 ms·
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 wi
by mort96 9y ago
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.
- xelxebar 9y agoI've definitely run into this on bash and zsh (iirc). I'm curious if this glob expansion behaviour is set in posix somewhere.