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

Re: [FWP] Re: Neat or horrid?



Adam Rice wrote:
> 
> Quoting David L. Nicol (david@kasey.umkc.edu):
> > --
> >                           David Nicol 816.235.1187 nicold@umkc.edu
> >                           find / -name core|perl -ne'chomp;unlink'
> 
> perl -e '$bad="/tmp/\n/etc/passwd\n/core"; foreach (split m[/], $bad) { mkdir($a.="/$_", 0755); }'
> find /tmp -name core
> /tmp/
> /etc/passwd
> /core
> 
> Be afraid. Be very afraid.

it's easier than remembering where fastrm is, and works on systems
that don't have innd.

It would be nice if find had an option to specify what the delimiter is,
or an option to specify that the delimiter is going to be \0 instead of \n.

I don't think \0 can be in a file name.  Can it?

This sort of manipulation is possible wherever find is used.

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