Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] bash and grep and diff
- Date: Wed, 11 Aug 2010 10:23:51 +0900
- From: Darren Cook <darren@example.com>
- Subject: Re: [tlug] bash and grep and diff
- References: <4C6137CE.2080100@example.com> <20100810135841.05409294.attila@example.com>
- User-agent: Thunderbird 2.0.0.24 (X11/20100317)
>> 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 Thanks to Edmund, Romeo, Attila, Pier, Stephen for the replies. Glad I asked now! > diff <(grep blah a.txt) <(grep blah b.txt) > > the <() runs a sub-shell and uses /dev/fdX as input file for the > diff command. ... Very clever. I just discovered it also works with meld (a visual diff program, written in python; it is lovely (*), but gets, very, very, VERY, slow on large files, so being able to filter like this is great): meld <(grep blah a.txt) <(grep blah b.txt) The filenames show up as /dev/fd/63 and /dev/fd/62. Darren *: You can click arrows to move blocks of differences from one file to another, can delete lines, and in fact do any kind of edit on either file. Horizontal scrollbars, so no more messing around with --width when using --side-by-side. Really nice for checking and tidying up code before an svn commit. -- 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)
- Follow-Ups:
- Re: [tlug] bash and grep and diff
- From: Josh Glover
- References:
- [tlug] bash and grep and diff
- From: Darren Cook
- Re: [tlug] bash and grep and diff
- From: Attila Kinali
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] New programming revision site - by a TLUG'er
- Next by Date: Re: [tlug] New programming revision site - by a TLUG'er
- Previous by thread: Re: [tlug] bash and grep and diff
- Next by thread: Re: [tlug] bash and grep and diff
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links