bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug with `-w' (`--ignore-all-space') option


From: Andreas Schwab
Subject: Re: Bug with `-w' (`--ignore-all-space') option
Date: Thu, 12 Nov 2009 16:07:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Khalukhin Alexander <address@hidden> writes:

> Here are two simple text files:
>
> address@hidden 1]$ cat test1.txt
> a a a a
>
> address@hidden 1]$ cat test2.txt
> a
> a
> a
> a
>
> Now I'm trying to find difference, using -w (or --ignore-all-space) option:
>
> address@hidden 1]$ diff -w test1.txt test2.txt
> 1c1,4
> < a a a a
> ---
>> a
>> a
>> a
>> a
>
>
> But judging to MANs they should have no differences:

diff always operates on lines, which separated by newlines that are not
considered part of them.

> http://www.gnu.org/software/diffutils/manual/html_node/diff-Options.html#diff%20Options
> -w --ignore-all-space Ignore white space when comparing lines. See White
> Space<http://www.gnu.org/software/diffutils/manual/html_node/White-Space.html#White%20Space>.
>
>
> http://www.gnu.org/software/diffutils/manual/html_node/White-Space.html#White%20Space
> The -w and --ignore-all-space options are stronger still. They ignore
> difference even if one line has white space where the other line has
> none. White
> space characters include tab, *newline*, vertical tab, form feed, carriage
> return, and space; some locales may define additional characters to be white
> space.
>
> Is it a BUG?

It's a documentation bug.

> Or how can I get wishing result (ignore newlines while comparing)?

Try wdiff.

Andreas.

-- 
Andreas Schwab, address@hidden
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]