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=$(locate "$*" | head -n 1))
[[ "${FILE}" ]] && cd $(dirname "${FILE}")


-- 
Neil Bothwick

Error reading FAT record: Try the SKINNY one? (Y/N)

Attachment: signature.asc
Description: PGP signature

Reply via email to