From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.62) (envelope-from ) id 1HmVwV-0005ow-JS for garchives@archives.gentoo.org; Fri, 11 May 2007 14:18:00 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.0/8.14.0) with SMTP id l4BEFurs018092; Fri, 11 May 2007 14:15:56 GMT Received: from desiato.localdomain (82-69-83-178.dsl.in-addr.zen.co.uk [82.69.83.178]) by robin.gentoo.org (8.14.0/8.14.0) with ESMTP id l4BE9jmU009782 for ; Fri, 11 May 2007 14:09:45 GMT Received: from hactar.digimed.co.uk (hactar.digimed.co.uk [192.168.1.2]) by desiato.localdomain (Postfix) with ESMTP id 8B19112B618 for ; Fri, 11 May 2007 15:09:44 +0100 (BST) Date: Fri, 11 May 2007 15:09:40 +0100 From: Neil Bothwick To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] locate Message-ID: <20070511150940.0e8d18b7@hactar.digimed.co.uk> In-Reply-To: <7ad4c500705110653x1e2d2a48i6070f2f9343829f7@mail.gmail.com> References: <7ad4c500705110534i2b153fe1y38f8640ff10c4fec@mail.gmail.com> <20070511134843.72ffea84@hactar.digimed.co.uk> <7ad4c500705110629w6f0c0d75vbe3784abff60e42a@mail.gmail.com> <20070511144307.403df66a@hactar.digimed.co.uk> <7ad4c500705110653x1e2d2a48i6070f2f9343829f7@mail.gmail.com> Organization: Digital Media Production X-Mailer: Claws Mail 2.9.2cvs5 (GTK+ 2.10.12; x86_64-pc-linux-gnu) X-GPG-Fingerprint: 7260 0F33 97EC 2F1E 7667 FE37 BA6E 1A97 4375 1903 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary=Sig_GdFRjUbo9jwaFiUrUdRYiT7; protocol="application/pgp-signature"; micalg=PGP-SHA1 X-Archives-Salt: 080f8ebe-2ed7-4e85-ab61-cab38504991c X-Archives-Hash: 1f8a2ad553907c1855094d2307f2cc8a --Sig_GdFRjUbo9jwaFiUrUdRYiT7 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 11 May 2007 15:53:42 +0200, Martin S wrote: > Forgot you're still toppost sensitive in this group. And always will be, once oyu've seen the one true way you don't change :) > Anyway I don't have a mouse on that system, so I'll have to use Alan > suggestion. You could use a script. e.g. #!/bin/sh # cdlocate.sh cd $(dirname $(locate $1 | head -n 1)) The head -n 1 will avoid it falling over when locate returns more than one hit, although it will still break if there are no hits. Maybe, although I haven't tested it, something like FILE=3D$(locate "$*" | head -n 1)) [[ "${FILE}" ]] && cd $(dirname "${FILE}") --=20 Neil Bothwick Error reading FAT record: Try the SKINNY one? (Y/N) --Sig_GdFRjUbo9jwaFiUrUdRYiT7 Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (GNU/Linux) iD8DBQFGRHkoum4al0N1GQMRArDgAKDcItMXjRAQmXYOVcw2m79fq4F++gCfVQrX xrLMTdz276unw5ll1IfpC1E= =7FT0 -----END PGP SIGNATURE----- --Sig_GdFRjUbo9jwaFiUrUdRYiT7-- -- gentoo-user@gentoo.org mailing list