zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: managing PATH, MANPATH, LD_LIBRARY_PATH, etc.
Date: Wed, 28 Jan 2015 10:39:28 -0800	[thread overview]
Message-ID: <150128103928.ZM3554@torch.brasslantern.com> (raw)
In-Reply-To: <E034D28C-0219-4365-8E6C-D7A37D9F584B@yost.com>

On Jan 28, 10:06am, Dave Yost wrote:
}
} Imagine a shell function called "paths". Doing this:
} 	paths set /usr/local /usr /
} wants to set PATH to this:
} 	/usr/local/bin
} 	/usr/local/sbin
} 	/usr/bin
} 	/usr/sbin
} 	/bin
} 	/sbin
} and does so, except that directories that don't exist, such as
} /usr/local/sbin, are not added.

Two things that occur to me:

(1) It's often a policy thing that only adminstrator users have "sbin"
directories in their path.

(2) There's really no reason to exclude non-existent directories, they
have no interesting effect on path search particularly given zsh's use
of the command hash table.  Unless they cause some problem for other
programs' use of other PATH-like variables?

} An important convenience of the paths function would be that it also
} works similarly for MANPATH, LD_LIBRARY_PATH, LIBRARY_PATH, and CPATH.

CPATH is GCC specific and only for build environments (isn't it?).  How
many such special cases might there be, and how would "paths" decide
when to in/exclude them?

} You can also do these:
} 	paths remove /usr/local/llvm/3.5.1
} 	paths addlast /usr/local/llvm/3.5.1
} 	paths addfirst /usr/local/llvm/3.5.1

"append" and "prepend"?

} Comments? Volunteers? Is this already out there somewhere?

Seems pretty similar to "add-zsh-hook" except with some extra rules.


      reply	other threads:[~2015-01-28 18:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28 18:06 Dave Yost
2015-01-28 18:39 ` Bart Schaefer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=150128103928.ZM3554@torch.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).