From owner-freebsd-questions Wed Nov 18 10:45:54 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id KAA17963 for freebsd-questions-outgoing; Wed, 18 Nov 1998 10:45:54 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from mail.itw.net (mail.itw.net [206.138.122.6]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id KAA17958 for ; Wed, 18 Nov 1998 10:45:51 -0800 (PST) (envelope-from gmann@itw.com) Received: from itw.com (Surfer2-106.tidalwave.com [208.211.4.106]) by mail.itw.net (VMailer) with ESMTP id EBC372BAB6; Wed, 18 Nov 1998 13:45:22 -0500 (EST) Message-ID: <36531668.2C2CD440@itw.com> Date: Wed, 18 Nov 1998 13:48:08 -0500 From: Glen Mann Organization: Phrantic Physics X-Mailer: Mozilla 4.04 [en] (X11; I; FreeBSD 2.2.7-RELEASE i386) MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG Subject: sh programming question Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Sorry if this should go elsewhere, but it should be pretty simple. In a Bourne shell script, I want to compare two lists, obtained e.g. with list1=`ls $dirname1` list2=`ls $dirname2` in order to determine what elements are in list1 and list2, or in one but not the other. The two lists will always be sorted, but not necessarily directory listings. I'd like to do this without using temporary files. I could use arrays in a Bash script and step through the lists, but want to stick with sh. Is there an easy way to do this, perhaps using sort and uniq? Thanks -Glen To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message