Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <430DBED4.5050107@byu.net> Date: Thu, 25 Aug 2005 06:51:32 -0600 From: Eric Blake User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) MIME-Version: 1.0 To: Adrian Marsh CC: cygwin AT cygwin DOT com Subject: Re: Diff and grep problems References: <430D94E7 DOT 4080700 AT lucent DOT com> <430DB7AC DOT 40207 AT byu DOT net> <430DBC53 DOT 70800 AT lucent DOT com> In-Reply-To: <430DBC53.70800@lucent.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [Ugh - top-posting. Reformatted] >> This is not cygwin specific. Read up on 'info diff' - the -X option is a >> file listing patterns of FILENAMES to ignore when diffing directories, >> not >> LINES to ignore within file pairs being diffed. Try -I instead. According to Adrian Marsh on 8/25/2005 6:40 AM: > Hi Eric, > > Thanks for the help. I'd already "man diff" and it doesn't read like it > applies only to files, but info tells me more : Like I said, 'info diff' is more informative than 'man diff', for a reason. The GNU project prefers info to man documentation. > >> `-I REGEXP' >> `--ignore-matching-lines=REGEXP' >> Ignore changes that just insert or delete lines that match REGEXP. >> *Note Specified Lines::. > > > However - this is a *changed* line, not an insert/delete so I don't > think it will work. Have you actually tried it? A changed line is a combination insert/delete, so it does work. $ cat > 1 a b c $ cat > 2 a bb c $ diff 1 2 2c2 < b - --- > bb $ diff -Ib 1 2 $ Any more non-cygwin specific questions on this topic are better asked on a newsgroup related to using unix utilities. > So my best guess is that I have to pre-grep the > files involved. However this brings me onto the second problem, where > grep seems to have the same issue (unless -f in grep ALSO only filters > filenames..) > But when I try this same thing in cygwins version of grep, it fails > (note the manual grep is ok). > >> C:\backups\__cisco_backups>cat c.txt >> ntp >> >> C:\backups\__cisco_backups>c:\cygwin\bin\grep -f c.txt a.txt >> >> C:\backups\__cisco_backups>c:\cygwin\bin\grep ntp a.txt >> ntp clock-period 17179955 >> ntp source Vlan135 >> ntp server 135.86.68.147 I'm guessing you have line-ending problems. And to make this email cygwin-specific, why aren't you using a Unix shell (bash, ksh, ...) instead of Windows .bat files? Also, check whether you are using binary mount points. - -- Life is short - so eat dessert first! Eric Blake ebb9 AT byu DOT net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDDb7U84KuGfSFAYARAv5zAJ0Znd5+/MIHLWBtAa/L6fo2bcif1ACdEjWc gHeOSlnLYO8PugZE9yB2VeY= =L4Od -----END PGP SIGNATURE----- -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/