bug-coreutils
[Top][All Lists]
Advanced

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

Re: Could we have a flag to tell us which directories were actually remo


From: Reuben Thomas
Subject: Re: Could we have a flag to tell us which directories were actually removed?
Date: Thu, 16 Aug 2007 00:03:51 +0100 (BST)

On Wed, 15 Aug 2007, Bob Proulx wrote:

Reuben Thomas wrote:
I just had a situation where this would have been useful. I tried -v
--ignore-fail-on-non-empty, but of course it told me about every directory
it processed, which is fine, but not what I wanted.

How about this?

 $ mkdir -p 1/2/3 11
 $ rmdir -v 1
 rmdir: removing directory, 1
 rmdir: 1: Directory not empty
 $ echo $?
 1

And this does not seem like the type of thing that needs to be
optimized for keyboard use but sounds more like something in a script.
In which case a little more verbose is okay.  That leads me to this:

 for dir in *; do
   rmdir $dir && echo removed: $dir  # or whatever you want to do here
 done

I wanted this for keyboard use, for multiple directories:

  rmdir [--magic-flag] *

in fact. Maybe it's just not common enough a case?

--
http://rrt.sc3d.org/ | maximiste, n.  pessimiste (Roux)




reply via email to

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