grep for craigslist?

Ben Scott dragonhawk at gmail.com
Wed Feb 13 11:27:20 EST 2013


On Wed, Feb 13, 2013 at 7:22 AM, David Rysdam <david at rysdam.org> wrote:
> [1] Except for the diff itself. The man page seems to indicate that you
> can get the "one-sided" differences by using some kind of format thing,
> but my diff won't take any of the options the man page gives for that
> and it's so confusingly written I can't even tell what is *supposed* to
> work. I eventually resorted to just
>
>     diff A B | grep \>

  I've always done

	diff -u A B | grep ^+

which is Unixy but I suppose inefficient.  This seems to work:

	diff \
		--old-line-format=''		\
		--new-line-format='%L'		\
		--unchanged-line-format=''	\
		A B

  There may be more elegant ways.

-- Ben


More information about the gnhlug-discuss mailing list