Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Tidying MANPATH
- X-seq: zsh-users 13164
- From: Daniel Qarras <dqarras@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Tidying MANPATH
- Date: Sat, 30 Aug 2008 06:38:25 -0700 (PDT)
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Message-ID; b=3c9sqzYR6OSMG+j9E1YnjEMa7iE8QysM/tH177vUTxdL24fyrTiIhlRwAy1FgKQlzGRP96miH5mADSvvPeubsdTGrD2CEkdJ4L9DQVR/nCzKxvwPx/MCCqcte42mJkbbPx0ySH3Vtg1yomdRIzyBJ90zqhWUygtK0n2ua8rcuzE=;
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Reply-to: dqarras@xxxxxxxxx
Hi,
for years I've used these tricks seen at zsh mailing lists to remove non-existing paths from PATH/MANPATH:
# Path cleaning
path=($^path(N)) # Remove non-existing dirs
manpath=($^manpath(N))
setopt EXTENDED_GLOB
path=(${${path//\/##/\/}%/}) # Remove trailing slashes,
manpath=(${${manpath//\/##/\/}%/}) # needs EXTENDED_GLOB
unsetopt EXTENDED_GLOB
typeset -U path manpath # Remove duplicate dirs
Now I've noticed that at least on Linux one can do a this kind of setting with MANPATH to also search system manpaths in addition to user's own paths:
MANPATH=/path1:/path2::/path3
That means that system manpaths are searched after /path1 and /path2 but before /path3. The problem is that while
manpath=($^manpath(N))
is probably the most clever one-liner I've seen it also removes the magical :: from manpath. The obvious question is that is there a way to spare :: easily or do I need to resort to some multi-line fixing with MANPATH?
Thanks!
Messages sorted by:
Reverse Date,
Date,
Thread,
Author