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: From: =?iso-8859-1?Q?Le_Dr=E9au_Philippe?= To: "'cygwin AT cygwin DOT com'" Subject: problem with diff -I 'regexp' Date: Fri, 15 Oct 2004 12:00:42 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-IsSubscribed: yes Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id i9F9vq6U013093 Hello : My problem : I'd like to ignore the lines beginning with -- $ diff -I '^--' test1.txt test2.txt 1,3c1,3 < 1when < --I want ? < #ok nok --- > 2when > --I want > #ok 5,6c5,6 < 2 < 3 --- > 4 > 5 8c8 < test 2 --- > test x The lines are in the output, why ? I obtain the same thig with the following similar commands : $ diff -I '^#' test1.txt test2.txt $ diff -I 'want' test1.txt test2.txt Why the regular expression is ignore? The input files : test1.txt 1when --I want ? #ok nok #end of comment 2 3 test 1 test 2 test2.txt 1when --I want #ok nok #end of comment 2 3 test 1 test 2 A normal command produces : $ diff test1.txt test2.txt 1,3c1,3 < 1when < --I want ? < #ok nok --- > 2when > --I want > #ok 5,6c5,6 < 2 < 3 --- > 4 > 5 8c8 < test 2 --- > test x An ignore option that runs (line 5 and 6 of the following disappear, that's ok): $ diff -I '^[[:digit:]]' test1.txt test2.txt 1,3c1,3 < 1when < --I want ? < #ok nok --- > 2when > --I want > #ok 8c8 < test 2 --- > test x Philippe Le Dréau -- 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/