Gentoo Logo
Gentoo Spaceship

Installation:
Gentoo Handbook
Installation Docs

Documentation:
Home
Listing
About Gentoo
Philosophy
Social Contract

Resources:
Bug Tracker
Developer List
Discussion Forums
Gentoo BitTorrents
Gentoo Linux Enhancement Proposals
IRC Channels
Mailing Lists
Mirrors
Name and Logo Guidelines
Online Package Database
Security Announcements
Staffing Needs
Supporting Vendors
View our CVS

Graphics:
Logos and themes
Icons
ScreenShots

Miscellaneous Resources:
Gentoo Linux Store
Gentoo-hosted projects
IBM dW/Intel article archive




List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Fabian Groffen <grobian@g.o>
Subject: Re: [OT] ecd function
Date: Tue, 8 Jul 2008 20:28:37 +0200
On 08-07-2008 19:59:05 +0200, Robert Buchholz wrote:
> You can avoid the issue with the license directory by appending a / at 
> the end. Grobian showed me that a function is useful for this, I just 
> do "ecd xorg-server"
> 
> $ grep -A 3 ecd ~/.bashrc
> function ecd () {
>       cd ~/devel/gentoo/gentoo-x86/*/$@/
> }

errr, just because my name is involved...

% alias ecd
cd $EPREFIX/usr/portage/*-*/!*

I have it as alias, not as function.  If you have a function you can
(and should) actually do more magic, like:

ecd() {
	[[ -z $1 ]] && return
	p=( $(echo /usr/portage/*/$1) )
	if [[ ${p[*]} == *"/*/"* ]] ; then
		echo "no such package: $1" > /dev/stderr
	elif [[ ${#p[@]} > 1 ]] ; then
		echo "multiple options: ${p[*]}"
	else
		# we can't handle spaces in the paths here anyway
		cd ${p[*]}
	fi
}

And probably this can be done even better with respect to the glob...


-- 
Fabian Groffen
Gentoo on a different level
-- 
gentoo-dev@g.o mailing list


References:
sci-libs/scipy -> dev-python/scipy ?
-- Andrey Grozin
Re: sci-libs/scipy -> dev-python/scipy ?
-- Donnie Berkholz
Re: sci-libs/scipy -> dev-python/scipy ?
-- Joe Peterson
Re: [gentoo-dev] sci-libs/scipy -> dev-python/scipy ?
-- Robert Buchholz
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: [gentoo-dev] sci-libs/scipy -> dev-python/scipy ?
Next by thread:
Re: sci-libs/scipy -> dev-python/scipy ?
Previous by date:
Re: [gentoo-dev] sci-libs/scipy -> dev-python/scipy ?
Next by date:
Re: [gentoo-commits] gentoo-x86 commit in www-client/opera: ChangeLog opera-9.51.ebuild


Updated Jun 17, 2009

Donate to support our development efforts.

Gentoo Centric Hosting: vr.org

VR Hosted

Tek Alchemy

Tek Alchemy

SevenL.net

SevenL.net

php|architect

php|architect

Copyright 2001-2007 Gentoo Foundation, Inc. Questions, Comments? Email www@gentoo.org.