From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Thu, 12 Mar 2015 10:17:41 -0700 To: 9fans@9fans.net Message-ID: In-Reply-To: References: <8f07dd60b7c8ad5c85e3b6ed8ac18a37@brasstown.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] fun with rc Topicbox-Message-UUID: 4963d76c-ead9-11e9-9d60-3106f5b1d025 On Thu Mar 12 10:09:06 PDT 2015, minux.ma@gmail.com wrote: > On Mar 12, 2015 12:52 PM, "erik quanstrom" wrot= e: > > so an interesting problem i run into from time to time is separately > computing > > the files added to and deleted from a directory in a shell script. u= niq > doesn't > > work for this. certainly one can loop over two lists of files and do > this easily, > > but that seems dull and tedious. > > > > but as it turns out, one can compute the deleted and added files > relatively > > efficiently with diff in two steps. obviously uniq -d gives us the > union, so > > > > fn =E2=88=A9 {echo $$1 $$2 | sed 's/ /\n/g' | sort | uniq -d} >=20 > Isn't this called (set) intersection? >=20 ; grep `{unicode =E2=88=A9} /lib/unicode 002229 intersection > > and uniq -u gives us not union > > > > fn not=E2=88=A9 {echo $$1 $$2 | sed 's/ /\n/g' | sort | uniq = -u} >=20 > this is (set) symmetric difference. that sounds like a reasonable name, but not one i remembered. - erik