Problems with rm -f

Paul Falstad pfalstad at phoenix.princeton.edu
Wed May 15 07:20:06 AEST 1991


>% rm -f .Mail/drafts/,*         Remove the , files (temp files)
>%             All okay!  :)
>
>% rm -f .Mail/drafts/,*         Do it again, _problems!_
>No match.
>%
>----------------
>
>What the heck is the -f option there for if it still throws up at you
>if files in a sub-directory don't exist? It works fine if you are _in_
>a that directory (i.e. 'rm -f ,*'  run twice in the sub-directory
>suppresses errors correctly)

csh handles the * expansion, not rm; it's csh that's complaining that
there are no matches for ",*".  So in the second case, rm is never even
executed.  The -f flag is useless in either case, because the shell
would never pass the names of nonexistent files along to rm (because you are
using globbing).  I have no idea why this worked if you were in the
directory.

Do something like "rm .Mail/drafts/,* >& /dev/null", or use a different
shell.

--
Paul Falstad                     | 10 PRINT "PRINCETON CS"
pfalstad at phoenix.princeton.edu   | 20 GOTO 10



More information about the Comp.unix.questions mailing list