Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

diff files from two file listings

20 views
Skip to first unread message

Why Tea

unread,
Sep 21, 2012, 9:29:12 PM9/21/12
to
I have two file listings of the files (file elements
of the same name but in different Clearcase branch),
what is the easiest way to run diff on each of the
file from the file listings? Perhaps Perl script?

Example:
listing1.txt
file1@@branch1
file2@@branch2
...

listing2.txt
file1@@branch2
file2@@branch2
...

The script would do the following:
diff file1@@branch1 file1@@branch2
diff file2@@branch1 file2@@branch2
and so on.

Thanks!

/WT

Barry Margolin

unread,
Sep 22, 2012, 2:05:20 AM9/22/12
to
In article <8718404c-9611-4783...@googlegroups.com>,
paste listing1.txt listing2.txt | while read f1 f2
do
diff $f1 $f2
done

--
Barry Margolin, bar...@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

Úcarenya

unread,
Sep 26, 2012, 10:41:50 PM9/26/12
to
Barry Margolin <bar...@alum.mit.edu>:
> In article <8718404c-9611-4783...@googlegroups.com>,
> Why Tea <ytl...@gmail.com> wrote:
>
> > I have two file listings of the files (file elements
> > of the same name but in different Clearcase branch),
> > what is the easiest way to run diff on each of the
> > file from the file listings? Perhaps Perl script?
> >
> > Example:
> > listing1.txt
> > file1@@branch1
> > file2@@branch2
> > ...
> >
> > listing2.txt
> > file1@@branch2
> > file2@@branch2
> > ...
> >
> > The script would do the following:
> > diff file1@@branch1 file1@@branch2
> > diff file2@@branch1 file2@@branch2
> > and so on.
>
> paste listing1.txt listing2.txt | while read f1 f2
> do
> diff $f1 $f2
> done
>

Only if file name contain no space, or you have to let paste -dX where X
is a char that never appears in filename.

--
- Úcarenya - infernoxu at gmail dot com
- http://ucarenya.com/

Kaz Kylheku

unread,
Sep 26, 2012, 11:06:01 PM9/26/12
to
On 2012-09-27, Úcarenya <infe...@gmail.com> wrote:
> Barry Margolin <bar...@alum.mit.edu>:
>> In article <8718404c-9611-4783...@googlegroups.com>,
>> Why Tea <ytl...@gmail.com> wrote:
>>
>> > I have two file listings of the files (file elements
>> > of the same name but in different Clearcase branch),

[ snip ]

>> paste listing1.txt listing2.txt | while read f1 f2
>> do
>> diff $f1 $f2
>> done
>>
>
> Only if file name contain no space, or you have to let paste -dX where X
> is a char that never appears in filename.

I think the OP can work out that detail by reading the man page;
you're not really adding to the value of Barry's answer.

Anyway, whereas simpleton end users may be forgiven for using spaces in file
names, the same cannot be said about users of version control, whom we
should be able to count on to be more disciplined.
0 new messages