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

Re: [FWP] Re: Neat or horrid?



Peter Scott wrote:
> 
> At 06:54 PM 6/1/00 +0000, David L. Nicol wrote:
> >I don't think \0 can be in a file name.  Can it?
> 
> No.  According to Stevens, the only prohibited characters are / and \0.


I didn't read far enough into the gnu find man page, gnu find supports
a -print0 option that will cause the file names to be null delimited.

So a good find chain becomes

(hey!  This is suggested in perldoc perlrun)

find /  -print0 | perl -n0e 'm/[^\w :@.All_Allowed_Characters]/ and unlink'


-- 
                          David Nicol 816.235.1187 nicold@umkc.edu
                      find / -name core -print0 | perl -n0e unlink

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe