cleanup script needed

Daniel R. Levy levy at ttrdc.UUCP
Fri Mar 10 10:37:31 AEST 1989


In article <80 at torsqnt.UUCP>, david at torsqnt.UUCP (David Haynes) writes:
> :No, try	"find . -name '*.dvi' -print | xargs rm".
> :
> Why not, 	"find . -type f -name '*.dvi' -exec rm {} \;" 	?

Which is better in some ways, since in the first example (using xargs) if rm
finds a *.dvi file without write permission to you or which it otherwise thinks
is unsuitable to be removed, it will say something like

foo/bar.dvi: 444 mode?

and then read a line from stdin.  This will swallow the next filename from
find, which was intended for xargs.  Of course rm -f will omit the check but
also will omit any warning for files you can't remove or that can be removed
but are not writeable by you.
-- 
Daniel R. Levy             UNIX(R) mail:  att!ttbcad!levy
AT&T Bell Laboratories
5555 West Touhy Avenue     Any opinions expressed in the message above are
Skokie, Illinois  60077    mine, and not necessarily AT&T's.



More information about the Comp.unix.questions mailing list