Re: [SLUG] File Renaming

From: Levi Bard (levi@bard.sytes.net)
Date: Fri Aug 20 2004 - 16:59:17 EDT


>> for i in `find "${dir}" -name '*' | grep '/[^$]'`
>>
>>
> ^^^^^^^^^
>Skip that... it's the same as
>
> for i in `find "${dir}" | grep '/[^$]'`
> ^^^^^^^^^^^^
>
>
Hmm, I wasn't 100% sure about the results if you didn't specify a name,
but it makes sense.

>What does this do?
>
>
The grep statement removes any somedir/ and somedir entries, leaving
just somedir/otherdir/filename - to preserve directory names.

>While I'm at it, you can do
>
> for i in `ls "${dir}" | grep '/[^$]'`
>
>
Not quite, because ls only gives me one depth of the directory tree,
where find gives me the whole thing. I considered ls -R, but find can
be adapted to more flexible purposes later.
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 15:04:33 EDT