Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Compare directories the most efficient way
- X-seq: zsh-users 9560
- From: Meino Christian Cramer <Meino.Cramer@xxxxxx>
- To: vincent@xxxxxxxxxx
- Subject: Re: Compare directories the most efficient way
- Date: Wed, 26 Oct 2005 01:54:40 +0200 (CEST)
- Cc: zsh-users@xxxxxxxxxx
- In-reply-to: <20051025084527.GK3741@xxxxxxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <20051025.050856.41172296.Meino.Cramer@xxxxxx> <fb6be96e0510242027r7b07429dh6ca31f55846079e7@xxxxxxxxxxxxxx> <20051025084527.GK3741@xxxxxxxxxxxxx>
From: Vincent Lefevre <vincent@xxxxxxxxxx>
Subject: Re: Compare directories the most efficient way
Date: Tue, 25 Oct 2005 10:45:27 +0200
> On 2005-10-25 12:27:28 +0900, Jean Chalard wrote:
> > > 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.
>
> Several problems:
> * If there's a file in theothertree that doesn't exist in onetree,
> you won't see the corresponding error.
> * I think you should use something like onetree/**/*(D^/) to include
> files starting with a dot, but not directories.
> * If there are special files (symlinks...), this is even more
> complicated.
>
> "diff -r" (possibly with -q) from the diffutils is probably a better
> choice.
Hi,
yes, indeed....there are dotted files in there...even directories are
dotted...and not found with the pattern above.
I didn't choose diff, since I wanted a more common (or is "general"
the better choice?) solution in case of haveing the task to feed two
corresponding files to a program, which "does" something with that
input.
keep zshing!
Meino
> --
> Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.org/>
> 100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
> Work: CR INRIA - computer arithmetic / SPACES project at LORIA
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author