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)
_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils