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

Re: Compare directories the most efficient way



>  There are two identical directory trees with binary stuff in it but
>  with a different prefix for example:
>   /home/user/onetree/.
>  and
>   /home/user/theothertree/.

I think I may have missed something here, because I can't see why something like

for i in onetree/**/*; do cmp -- "$i" "${i/onetree/theothertree}"; done

...wouldn't work.
It wouldn't split the filenames on spaces, and I don't think any ascii
or non-ascii bizarreness would affect that kind of thing.


>  The problem is to write a function/routine/script or whatever to do
>  that job. Everything tried result in errors like:
>
>    This   : file not found
>    is     : file not found
>    one    : file not found
>    file   : file not found
>    with   : file not found
>    spaces : file not found
>    .bz2   : file not found
>
>  I tried "find <path> -ls | cut -b 69- " as a source for escaped filenames
>  in a for/do/done-loop but it failed the same way as mentioned above.

As I see it this is most likely caused by the sh_word_split option set
(which you probably *really* don't want most of the time), and the
absence of any quoting mark.

--
J
"Toi, je te trouve pas la même tête que sur la page précédente" -- Wakamiya


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