Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: script within find



On 4/25/07, Matt Wozniski <godlygeek@xxxxxxxxx> wrote:
If I'm understanding your question correctly, you want to create a
copy of ./tifs called ./jpgs, and have the copy only contain
directories, no files.  Is that correct?

Yes.

If so, the following should tackle it:

for dir in tifs/**/*(/)
mkdir -p ${dir/tifs/jpgs}

I'm sure that there's a better way to do this that only requires an
"mkdir -p" on each leaf directory, but I can't think of it at the
moment and this should do what you want, if a bit inefficiently.

Cool, and nice use of zsh features already!  This is an artistic
question -- I've been doing different things to mirror a directory
structure only (without files yet), and zsh seems to have some power
features which make it simpler.

Cheers,
Alexy



Messages sorted by: Reverse Date, Date, Thread, Author