Find and separate files/dirs with spaces...

Björn Lindberg d95-bli.no at spam.nada.kth.se
Wed Feb 6 16:49:02 PST 2002


Remy Bosch wrote:

> > find . |
> > while read i
> > do
> >       chmod 0600 "$i"
> >       # ...etc
> > done
> >
> >
> > Björn
> 
> Sorry, same result...  :-(

As you can see below it works, but I suggest you try Simon's find/xargs
solution, since it's shorter. :-)

bjorn at nex:~/tmp/tmp> ll
total 0
-rw-r--r--   1 bjorn    users           0 Feb  7 01:43 a a
-rw-r--r--   1 bjorn    users           0 Feb  7 01:43 b b
-rw-r--r--   1 bjorn    users           0 Feb  7 01:43 c c
bjorn at nex:~/tmp/tmp> find . -type f | while read i; do chmod 0600 "$i";
done
bjorn at nex:~/tmp/tmp> ll
total 0
-rw-------   1 bjorn    users           0 Feb  7 01:43 a a
-rw-------   1 bjorn    users           0 Feb  7 01:43 b b
-rw-------   1 bjorn    users           0 Feb  7 01:43 c c
bjorn at nex:~/tmp/tmp>


Björn
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe blfs-support' in the subject header of the message



More information about the blfs-support mailing list