Mailing List Archive


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

Re: [tlug] bash and grep and diff



This should do the trick

diff <(grep "ABC" a.txt) <(grep "ABC" b.txt)

     Pier

On Tue, Aug 10, 2010 at 20:28, Darren Cook <darren@example.com> wrote:
I often want to run diff on just a subset of two files. I.e.
 grep "ABC" a.txt >tmp1.txt
 grep "ABC" b.txt >tmp2.txt
 diff tmp1.txt tmp2.txt

Is there a way to do that in a single line, without having to create
temp files?  (From a bash commandline, if at all possible.)  (There is
only one stdin pipe, so I'm guessing not, but thought it wouldn't hurt
to ask...)

Darren


--
Darren Cook, Software Researcher/Developer

http://dcook.org/gobet/  (Shodan Go Bet - who will win?)
http://dcook.org/work/ (About me and my work)
http://dcook.org/blogs.html (My blogs and articles)

--
To unsubscribe from this mailing list,
please see the instructions at http://lists.tlug.jp/list.html

The TLUG mailing list is hosted by the award-winning Internet provider
ASAHI Net.
Visit ASAHI Net's English-language Web page: http://asahi-net.jp/en/


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links