Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Possibly dumb question... Constructing PATH
- X-seq: zsh-users 14372
- From: Christopher Browne <cbbrowne@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Possibly dumb question... Constructing PATH
- Date: Mon, 14 Sep 2009 21:11:37 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=yyTBQ+dns/oBakjRqwkTRR4En2gQuKlCGCtH8V08GzQ=; b=KVOLdm81EGKMAXGIGMDAH0U+bROmefQ5afHMVV3Xsw0JCKQOv/2QgzZ0Ms/8r9/WN5 Yfxx2/n+vMVAsK5DkkCx1XwMwDVmcdAMQCski6+vXGyHtPNcHaaRcOPT453/3euP52vF 7Q+ibiV7p3zPb6XAWDUyxTeONGyFowURunePw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=ZH1UACpjhd3lpqKkZEATThHpt+p0zdWKFl3kDUDUKhu79KJAM6qzZEwGAtUsYW+Fi8 4qYSNEnr1U/QLEnKzx9fg9Va5TbTPo/a3pYIcjKzB9x6tTKkrA8+zyE8cFw4z4BWluP3 0U5Ks50ItcKKHzzAkHiWP24uKhCNzxUTNY0v0=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
I'm redoing some of my .rc files, and was wondering if there's a
common idiom for "add that path to PATH, if it's missing"?
In my .emacs/init.el, I have this concept...
(defun add-extra-path (raw-proposal)
(let ((proposal (expand-file-name raw-proposal)))
(if (not (member proposal load-path))
(setq load-path (cons proposal load-path)))))
I have a number of paths I add to the Emacs load-path using the above,
by looping across them and adding the ones that aren't already there.
What I'm thinking of is something like..
for pathproposal in ${HOME}/bin /usr/bin /bin /usr/local/bin [cast of
additional "teeming masses"]; do
if [path-proposal is not in $PATH]
PATH=$path-proposal:$PATH
fi
done
Is there any funky slick way to do that check? Or might I just as
well do an "echo | egrep"?
--
http://linuxfinances.info/info/linuxdistributions.html
Joan Crawford - "I, Joan Crawford, I believe in the dollar.
Everything I earn, I spend." -
http://www.brainyquote.com/quotes/authors/j/joan_crawford.html
Messages sorted by:
Reverse Date,
Date,
Thread,
Author