From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16212 invoked from network); 27 Aug 2002 17:20:39 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 27 Aug 2002 17:20:39 -0000 Received: (qmail 3511 invoked by alias); 27 Aug 2002 17:20:22 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 5298 Received: (qmail 3496 invoked from network); 27 Aug 2002 17:20:21 -0000 Date: Tue, 27 Aug 2002 19:20:20 +0200 From: Phil Pennock To: zsh-users@sunsite.dk Subject: Re: how to? Message-ID: <20020827192020.A7905@globnix.org> Mail-Followup-To: zsh-users@sunsite.dk References: <20020823133510.2B8EC5B5@mercea.net> <20020827103427.GJ21595@freepuppy.bellavista.cz> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="y0ulUmNC+osPPQO6" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020827103427.GJ21595@freepuppy.bellavista.cz>; from neuhauser@bellavista.cz on Tue, Aug 27, 2002 at 12:34:27PM +0200 X-Disclaimer: Any views expressed in this message, where not explicitly attributed otherwise, are mine and mine alone. Such views do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. --y0ulUmNC+osPPQO6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2002-08-27 at 12:34 +0200, Roman Neuhauser wrote: > From: Scott Lipcon > > I'd like to be able to do an ls in a directory of source code while > > its being built, and basically say: show me all the .c files for which > > there doesn't exist a .o file. Right now I'm using: > >=20 > > ls -1 *.[co] | cut -f 1 -d"." | uniq -c | grep 1 > This made me look in the uguide, and looks like there's a variation > of this is (requires EXTENDED_GLOB): >=20 > % print *.c~f* >=20 > it works in this form, but isn't usable for the original task. > Neither my copy of zsh manual nor user guide mention that this > shouldn't work, but it doesn't: >=20 > roman@freepuppy ~/tmp/foo 1030:0 > ls > bar.c bar.o baz.c baz.o foo.c > roman@freepuppy ~/tmp/foo 1031:0 > ls *.c~f* > bar.c baz.c > roman@freepuppy ~/tmp/foo 1032:0 > ls *.c~*.o > bar.c baz.c foo.c > roman@freepuppy ~/tmp/foo 1033:0 >=20 >=20 > could anyone explain this to me? The extended glob used excludes those filenames which match the second glob. The first one excludes filenames starting with "f". The second excludes those ending ".o". If a filename ends ".c" then it can not also, at the same time, end ".o". This says nothing about whether or not there exists a different filename which has the same basename, but ends ".o" instead of ".c". --=20 Some mornings it's just not worth gnawing through the straps. --y0ulUmNC+osPPQO6 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (OpenBSD) iD8DBQE9a7TTfDS04Uzk9lURAukkAJ9aTvkxKffhcseuDZJnrU7ncLlbGwCfXPdu 3/R5uYYy1s7qgXPs+MWaToc= =aCjJ -----END PGP SIGNATURE----- --y0ulUmNC+osPPQO6--