4 ms·
That's accurate. `rm -rf /* ` will still work to delete everything. But that said, `rm -rf "$STREAMROOT/"` can't ever expand to that, and more-over since the ex
by DSMan195276 12y ago
That's accurate. `rm -rf /* ` will still work to delete everything. But that said, `rm -rf "$STREAMROOT/"` can't ever expand to that, and more-over since the expansions in double-quotes it won't be subject to path expansion by bash. So even "/* /", which would normally expand into "/bin/ /dev/ /etc/ ..." won't. You can see what I mean yourself, just use echo:
`echo /* `: /bin /dev /etc /lib ...
`echo /*/`: /bin/ /dev/ /etc/ /lib/ ...
`echo "/*"`: /*
`echo "/*/"`: /*/
If you try it with `ls`, you'll find that `ls "/* "` results in `ls: "/* ": no such file or directory`.
Edit: Formatting.
- pskocik 12y agoThe original example was `rm -rf "$STREAMROOT/"*`, though (the asterisk being out of the double quotes.) Now that glob will expand.
- DSMan195276 12y agoAh, my apologies, I think that was HackerNew's markup at work. The '* ' wasn't there when I looked before.