Note that there are some explanatory texts on larger screens.

plurals
  1. PODiff: ignoring lines with just tabs
    primarykey
    data
    text
    <p>I'm trying to diff files, and determine if they are the same, but ignoring ALL whitespace. </p> <p>When using <code>diff</code>, the <code>-b</code> tells <code>diff</code> to ignore whitespace on a given line. The <code>-B</code> option tells it to ignore all blank lines. But, if you have a line which contains only spaces, the <code>-B</code> and <code>-b</code> don't seem to work together.</p> <p>I've resorted to using the <code>-I</code> option, where I want diff to ignore all lines which only contain whitespaces, which works fine when the line contains only spaces, but the <code>\t</code> doesn't seem to match tab characters. </p> <p>I found one reference online that mentioned that you need to use POSIX regexp, but POSIX states that <code>:blank:</code> will match any whitespace (including tab). That does not work either. </p> <p>Here's a sample of what I'm trying to do. Ideally, my <code>diff</code> line would state that <code>t1.txt</code>, <code>t2.txt</code> and <code>t3.txt</code> were all the same.</p> <pre><code>bash#&gt; echo hi &gt; t1.txt bash#&gt; echo hi &gt; t2.txt bash#&gt; echo hi &gt; t3.txt bash#&gt; echo " " &gt;&gt; t2.txt bash#&gt; echo -e "\t" &gt;&gt; t3.txt bash#&gt; diff -BbaNq -I "^[ \t]*$" t1.txt t2.txt bash#&gt; diff -BbaNq -I "^[ \t]*$" t1.txt t3.txt Files t1.txt and t3.txt differ bash#&gt; diff -BbaNq -I "^[:blank:]*$" t1.txt t3.txt Files t1.txt and t3.txt differ bash#&gt; </code></pre> <p>Any help in what the syntax for <code>diff</code> would be would be very helpful.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload