Fun with *
Michael I. Bushnell
mike at turing.unm.edu
Sun Nov 20 15:48:01 AEST 1988
In article <17263 at agate.BERKELEY.EDU> weemba at garnet.berkeley.edu (Obnoxious Math Grad Student) writes:
>I'm not asking about how to remove the file (thanks, anyway, although
>I see the how-many-ways-to-do-so discussion is starting up again): I'm
>just saying that "while you're at it [ie, `fixing' rm *]", you as might
>as well consider the problem of the user who wants to remove some of his
>files, and types "rm -i *", expecting to get interactive prompting, and
>instead has all his files removed. If the first file is "-f", you now
>have one unhappy user.
Actually you don't:
Script started on Sat Nov 19 22:42:02 1988
turing.unm.edu 1 ls
foo
turing.unm.edu 2 touch ./-f
turing.unm.edu 3 ls
-f foo
turing.unm.edu 4 rm -i *
rm: remove foo? y
turing.unm.edu 5 ls
-f
turing.unm.edu 6 ^D
script done on Sat Nov 19 22:42:23 1988
All that happens is that ./-f isn't removed. As the man page *and*
the source (RTFS, you know...) say, -f prevents error messages and the
asking of questions for files you can't write.
N u m q u a m G l o r i a D e o
\ Michael I. Bushnell
\ HASA - "A" division
/\ mike at turing.unm.edu
/ \ {ucbvax,gatech}!unmvax!turing.unm.edu!mike
More information about the Comp.unix.wizards
mailing list