I'm more curious about the ~* part. Is the behavior triggered by a tcsh peculiarity that no longer works that way these days? Why would ~* trigger he behavior of deleting every home directory?
And aren't Emacs backup names appended with ~ rather than prepended? In that case shouldn't it be "~" (anything ending in ~) instead of "~*"?
The story sounds a bit flimsy regardless. Not that it's improbable but rather the opposite, rm -rf* stories are a dime a dozen.
I ran a quick test on multiple tcsh versions I had installed, the oldest being 6.13 (2004, RedHat 4). All returned 'Unknown user: *.'
It wouldn't surprise me if at some point this expanded to every user's home directory, the way '~username' expands to /home/username, or wherever that user's home is.
I couldn't find anything of note in https://github.com/tcsh-org/tcsh/blob/master/Fixes
Try it yourself: https://infinitemac.org/1989/NeXTStep%201.0
alex@world RevelCode % echo ~
/Users/Alex
alex@world RevelCode % ls ~*
alex@world RevelCode %
I am also curious how `~*` expanded to an equivalent of `/users/*`.NOMATCH - print error when glob doesn't match;
NO_NOMATCH - print literal GLOB character:
setopt NOMATCH
ls * => zsh: no matches found: *
setopt NO_NOMATCH
ls * => ls '*'
NULL_GLOB - when glob doesn't match, return blank; (Overrides NOMATCH): setopt NULL_GLOB
ls * => ls ''
# Brings behavior inline with RHEL/Bash4 defaults:
setopt NO_NOMATCHAnd yes, this is a potential footgun:
% touch ~test
zsh: no such user or named directory: test
% touch "~test"
% ls ~*
~test
% rm ~test
zsh: no such user or named directory: test
% rm "~test"
% ls ~*
%csh on NeXTStep 1.0:
localhost> echo ~
/me
localhost> echo ~*
echo: No match.Done.
Not sure how it got that way as I just copy / pasted the headline from the article. Autocorrect?
(headline needs to be fixed - article gives -rf as the option used not -RF)