bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bug with rm


From: Bob Proulx
Subject: Re: bug with rm
Date: Tue, 14 May 2002 11:19:40 -0600

> I work with a program called ADF that uses different scripts that
> have in the end the following commands : rm -f t21* and rm -f [A-Z]*
> logfile .
>    The problem is that this command removes everything inside the
> directory instead of only the specified files.

Hmm...  Unfortunately you have not furnished quite enough to debug the
problem.  But I think the problem is that something is matching those
filenames and those things are what are getting removed.  Try this to
get some more information.  Change the script to echo out what will be
removed instead of actually removing them.

  echo rm -f t21*
  echo rm -f [A-Z]*

What does it say?  I am guessing that you will see files that you do
not expect are being matched by those patterns.  Since the wildcards
are being expanded by the shell the rm command just does as it is
told.  I really suspect shell globbing to be the reason.  (Globbing is
where the shell expands '*' to match a glob of characters.)

If that is not the problem then we would need the OS you are running
on with 'uname -a', the version of rm with 'rm --version' and a
directory listing both before and after with 'ls -l'.

Hope that helps
Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]