diff question

Eric Cope eric.cope at gmail.com
Mon Oct 22 15:56:58 MST 2012


I was reading some docs and it mentioned that this only works if the
comment is in both files. can you confirm?

On Mon, Oct 22, 2012 at 2:36 PM, Brian Cluff <brian at snaptek.com> wrote:

> If you want to kill lines that start with // then you need to anchor it to
> the beginning of the line with ^.  If you want to also get comments that
> start with spaces or tabs you can also add \s to match white space followed
> by a * to match 0 or more occur aces of white space.
>
> So the line you would want to use would look like:
>
> diff -I '^\s*//' file1 file2
>
> Also note that I put it in single quotes to keep the shell from escaping
> some characters.
>
> Brian Cluff
>
>
> On 10/22/2012 01:59 PM, Eric Cope wrote:
>
>> Hi all,
>> I am trying to diff between two sets of files. I want to ignore comments
>> (lines that start with //).
>> I've tried
>>
>>   * diff -I "//" file1 file2
>>   * diff -I "\/\/" file1 file2
>>   * diff -I "//.* file1 file2
>>
>>
>> among others. Has anyone successfully used diff and its ignore option?
>>
>> Thanks,
>> Eric
>>
>>
>> ------------------------------**---------------------
>> PLUG-discuss mailing list - PLUG-discuss at lists.plug.**phoenix.az.us<PLUG-discuss at lists.plug.phoenix.az.us>
>> To subscribe, unsubscribe, or to change your mail settings:
>> http://lists.PLUG.phoenix.az.**us/mailman/listinfo/plug-**discuss<http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss>
>>
>>
> ------------------------------**---------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.plug.**phoenix.az.us<PLUG-discuss at lists.plug.phoenix.az.us>
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.**us/mailman/listinfo/plug-**discuss<http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.PLUG.phoenix.az.us/pipermail/plug-discuss/attachments/20121022/a6e14441/attachment.html>


More information about the PLUG-discuss mailing list