Discussion:
[ast-developers] AST find(1) does not support -delete option
Irek Szczesniak
2013-08-02 14:16:00 UTC
Permalink
Forwarding this from the Illumos bug tracker:

find(1) does not support -delete option. It is needed for GNU find(1)
and Solaris/Illumos find(1) compatibility to handle software which
expects this option to be there.

GNU find(1) defines -delete as:

-delete
Delete files; true if removal succeeded. If the removal failed,
an error message is issued. If -delete fails, find's exit sta-
tus will be nonzero (when it eventually exits). Use of -delete
automatically turns on the `-depth' option.

Warnings: Don't forget that the find command line is evaluated
as an expression, so putting -delete first will make find try to
delete everything below the starting points you specified. When
testing a find command line that you later intend to use with
-delete, you should explicitly specify -depth in order to avoid
later surprises. Because -delete implies -depth, you cannot
usefully use -prune and -delete together.

-depth Process each directory's contents before the directory
itself. The -delete action also implies -depth.

Irek
Glenn Fowler
2013-08-02 17:05:45 UTC
Permalink
this will be in the next alpha along with a -show option that shows
actions without doing them -- a bit safer than the
"don't forget -depth etc when debugging" warning
Post by Irek Szczesniak
find(1) does not support -delete option. It is needed for GNU find(1)
and Solaris/Illumos find(1) compatibility to handle software which
expects this option to be there.
-delete
Delete files; true if removal succeeded. If the removal failed,
an error message is issued. If -delete fails, find's exit sta-
tus will be nonzero (when it eventually exits). Use of -delete
automatically turns on the `-depth' option.
Warnings: Don't forget that the find command line is evaluated
as an expression, so putting -delete first will make find try to
delete everything below the starting points you specified. When
testing a find command line that you later intend to use with
-delete, you should explicitly specify -depth in order to avoid
later surprises. Because -delete implies -depth, you cannot
usefully use -prune and -delete together.
-depth Process each directory's contents before the directory
itself. The -delete action also implies -depth.
Irek
_______________________________________________
ast-developers mailing list
ast-developers at lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers
Cedric Blancher
2013-08-02 17:42:46 UTC
Permalink
Post by Glenn Fowler
this will be in the next alpha along with a -show option that shows
actions without doing them -- a bit safer than the
"don't forget -depth etc when debugging" warning
Are you going to include Roland's readlink(1) builtin work for the
next alpha, too?

Ced
--
Cedric Blancher <cedric.blancher at gmail.com>
Institute Pasteur
Continue reading on narkive:
Loading...