Message from discussion
Is it possible to return the line available in FILE1 but not FILE2 in diff?
Received: by 10.68.202.68 with SMTP id kg4mr8355349pbc.3.1352769602278;
Mon, 12 Nov 2012 17:20:02 -0800 (PST)
Path: 6ni78244pbd.1!nntp.google.com!news.glorb.com!usenet.stanford.edu!not-for-mail
From: Charles Swiger <ch...@pkix.net>
Newsgroups: gnu.utils.bug
Subject: Re: Is it possible to return the line available in FILE1 but not
FILE2 in diff?
Date: Mon, 12 Nov 2012 16:40:01 -0800
Lines: 40
Approved: bug-gnu-ut...@gnu.org
Message-ID: <mailman.12862.1352769601.855.bug-gnu-utils@gnu.org>
References: <CABrM6wmEk1upRvsotiB+a-W51CisZ+mVMHJATd095Ze=fq88Sw@mail.gmail.com>
NNTP-Posting-Host: lists.gnu.org
Mime-Version: 1.0 (Apple Message framework v1085)
X-Trace: usenet.stanford.edu 1352769601 3622 208.118.235.17 (13 Nov 2012 01:20:01 GMT)
X-Complaints-To: action@cs.stanford.edu
Cc: bug-gnu-ut...@gnu.org
To: Peng Yu <pengyu...@gmail.com>
Envelope-to: bug-gnu-ut...@gnu.org
X-Virus-Scanned: amavisd-new at codefab.com
In-Reply-To: <CABrM6wmEk1upRvsotiB+a-W51CisZ+mVMHJATd095Ze=fq88Sw@mail.gmail.com>
X-Mailer: Apple Mail (2.1085)
X-detected-operating-system: by eggs.gnu.org: Mac OS X 10.x
X-Received-From: 24.103.228.244
X-BeenThere: bug-gnu-ut...@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for the GNU utilities <bug-gnu-utils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-utils>,
<mailto:bug-gnu-utils-requ...@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-gnu-utils>
List-Post: <mailto:bug-gnu-ut...@gnu.org>
List-Help: <mailto:bug-gnu-utils-requ...@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-utils>,
<mailto:bug-gnu-utils-requ...@gnu.org?subject=subscribe>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Hi--
On Nov 12, 2012, at 3:19 PM, Peng Yu wrote:
> I just want to return the line available in FILE1 but not FILE2 in
> diff. After I read the document, it seems that this is not possible.
> Could anybody confirm whether this is true? If so, is there an
> alternative tool that does this? Thanks!
Using diff will show removed lines with a "-"; otherwise, consider
using the comm utility since that might be closer to what you want...
% cat > FILE1
This=20
is =20
a=20
test
file.
% tail -4 FILE1 >! FILE2 =
=
% diff -bdu FILE1 FILE2
--- FILE1 2012-11-12 16:37:45.000000000 -0800
+++ FILE2 2012-11-12 16:38:11.000000000 -0800
@@ -1,4 +1,3 @@
-This
is
a
test
% comm FILE1 FILE2
This
is
a
test
file.
Regards,
--=20
-Chuck