Re: diff files matching a pattern

2008-02-26 Thread Kamaraju S Kusumanchi
Raj Kiran Grandhi wrote: > Mark Neidorff wrote: >> Excuse me. I don't want to appear rude, but are you a student at Cornell >> and are we doing your CS homework for you? > > Excuse me. I don't want to appear rude, but you could have foud it out > yourself had you bothered to visit the OP's webpa

Re: diff files matching a pattern

2008-02-26 Thread Kamaraju S Kusumanchi
Mark Neidorff wrote: > Excuse me. I don't want to appear rude, but are you a student at Cornell > and are we doing your CS homework for you? > No offense taken... First, I would love to find a course here at Cornell (or online for that matter) which gives problems such as this for homework! If

Re: diff files matching a pattern

2008-02-26 Thread Raj Kiran Grandhi
Mark Neidorff wrote: Excuse me. I don't want to appear rude, but are you a student at Cornell and are we doing your CS homework for you? Excuse me. I don't want to appear rude, but you could have foud it out yourself had you bothered to visit the OP's webpage/blog mentioned in his signature.

Re: diff files matching a pattern

2008-02-26 Thread Mark Neidorff
Excuse me. I don't want to appear rude, but are you a student at Cornell and are we doing your CS homework for you? On Sunday 24 February 2008 02:21 pm, Kamaraju S Kusumanchi wrote: > Let's say I have two directories dir1, dir2 each with 1000 files. > Of these 1000 files in each directory, there

Re: diff files matching a pattern

2008-02-26 Thread Richard Lyons
On Tue, Feb 26, 2008 at 01:12:09PM -0500, Kamaraju S Kusumanchi wrote: > Richard Lyons wrote: > > >> Damn the shell! Did not even think about this. Thanks Rajki. > > > > You should have read _my_ solution on sunday. There was a note about > > this in the comments at the top. > > > > You are

Re: diff files matching a pattern

2008-02-26 Thread Kamaraju S Kusumanchi
Richard Lyons wrote: >> Damn the shell! Did not even think about this. Thanks Rajki. > > You should have read _my_ solution on sunday. There was a note about > this in the comments at the top. > You are right, I should've. Thanks for the script, Richard. I basically looked at Raj Kiran's scr

Re: diff files matching a pattern

2008-02-26 Thread Richard Lyons
On Tue, Feb 26, 2008 at 10:50:57AM -0500, Kamaraju S Kusumanchi wrote: > Raj Kiran Grandhi wrote: > > > The pattern should be in quotes, so that the shell does not expand it > > and it gets passed to your script. > > > > So it should be > > $patlist "file*" > > > > Damn the shell! Did not even

Re: diff files matching a pattern

2008-02-26 Thread Kamaraju S Kusumanchi
Raj Kiran Grandhi wrote: > The pattern should be in quotes, so that the shell does not expand it > and it gets passed to your script. > > So it should be > $patlist "file*" > Damn the shell! Did not even think about this. Thanks Rajki. raju -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] wit

Re: diff files matching a pattern

2008-02-26 Thread Raj Kiran Grandhi
Kamaraju S Kusumanchi wrote: I must be doing something wrong here. Consider this reduced problem. I tried to write a script to list all the files matching a specific pattern. Consider $cat ~/bin/patlist #! /bin/sh # to list all the files matching a given pattern # call as patlist pattern="$1"

Re: diff files matching a pattern

2008-02-26 Thread Kamaraju S Kusumanchi
Raj Kiran Grandhi wrote: > #call as script-name dir1 dir2 > pattern="$1" > dir1="$2" > dir2="$3" > for file in $dir1/$pattern; do > diff $file dir2${file##${dir1}} > done > I must be doing something wrong here. Consider this reduced problem. I tried to write a script to list all the files

Re: diff files matching a pattern

2008-02-24 Thread Raj Kiran Grandhi
Kamaraju S Kusumanchi wrote: Eduardo M KALINOWSKI wrote: for i in `seq 1 50`; do diff dir1/file$i.txt dir2/file$i.txt > diff$i.txt ; done Ok, this works on the command line. But I am looking for something along the lines of bash_script_name dir1/pattern1 dir2/pattern2 where dir1/pattern1,

Re: diff files matching a pattern

2008-02-24 Thread Richard Lyons
On Sun, Feb 24, 2008 at 03:12:34PM -0500, Kamaraju S Kusumanchi wrote: > Tzafrir Cohen wrote: > > > > LC_ALL=C diff -r dir1 dir2 | grep -v ^Only > > > > The size really doesn't matter for those extra large files. > > > > This works only if the extra 950 files are in just one directory. If the

Re: diff files matching a pattern

2008-02-24 Thread Tzafrir Cohen
On Sun, Feb 24, 2008 at 03:12:34PM -0500, Kamaraju S Kusumanchi wrote: > Tzafrir Cohen wrote: > > > > LC_ALL=C diff -r dir1 dir2 | grep -v ^Only > > > > The size really doesn't matter for those extra large files. > > > > This works only if the extra 950 files are in just one directory. If the >

Re: diff files matching a pattern

2008-02-24 Thread Kamaraju S Kusumanchi
Tzafrir Cohen wrote: > > LC_ALL=C diff -r dir1 dir2 | grep -v ^Only > > The size really doesn't matter for those extra large files. > This works only if the extra 950 files are in just one directory. If the extra files are there in both the directories, then it does not make sense to compare al

Re: diff files matching a pattern

2008-02-24 Thread Tzafrir Cohen
On Sun, Feb 24, 2008 at 02:21:56PM -0500, Kamaraju S Kusumanchi wrote: > Let's say I have two directories dir1, dir2 each with 1000 files. > Of these 1000 files in each directory, there are 50 files named file1.txt, > file2.txt ... file50.txt. The rest of the files do not follow any pattern > and a

Re: diff files matching a pattern

2008-02-24 Thread Richard Lyons
On Sun, Feb 24, 2008 at 02:21:56PM -0500, Kamaraju S Kusumanchi wrote: > Let's say I have two directories dir1, dir2 each with 1000 files. > Of these 1000 files in each directory, there are 50 files named file1.txt, > file2.txt ... file50.txt. The rest of the files do not follow any pattern > and

Re: diff files matching a pattern

2008-02-24 Thread Kamaraju S Kusumanchi
Eduardo M KALINOWSKI wrote: >> >> Manually diffing the files 50 times is cumbersome. Something like >> >> diff dir1/file*.txt dir2/file*.txt >> >> is what I am after. I do not want to do >> >> diff -r dir1 dir2 >> >> since that compares the other 950 files as well besides the 50 files that >> I wa

Re: diff files matching a pattern

2008-02-24 Thread strawks
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Eduardo M KALINOWSKI wrote: > Kamaraju S Kusumanchi wrote: [...] >> Manually diffing the files 50 times is cumbersome. Something like >> >> diff dir1/file*.txt dir2/file*.txt >> >> is what I am after. I do not want to do >> >> diff -r dir1 dir2 [...] >

Re: diff files matching a pattern

2008-02-24 Thread Michael Marsh
On Sun, Feb 24, 2008 at 2:21 PM, Kamaraju S Kusumanchi <[EMAIL PROTECTED]> wrote: > Let's say I have two directories dir1, dir2 each with 1000 files. > Of these 1000 files in each directory, there are 50 files named file1.txt, > file2.txt ... file50.txt. The rest of the files do not follow any pa

Re: diff files matching a pattern

2008-02-24 Thread Eduardo M KALINOWSKI
Kamaraju S Kusumanchi wrote: Let's say I have two directories dir1, dir2 each with 1000 files. Of these 1000 files in each directory, there are 50 files named file1.txt, file2.txt ... file50.txt. The rest of the files do not follow any pattern and are very large in size. Now is there any way to