[clug] path with wildcards

Tony Breeds tony at bakeyournoodle.com
Thu Aug 2 07:04:38 GMT 2007


On Thu, Aug 02, 2007 at 04:52:46PM +1000, Michael.James at csiro.au wrote:
> Where should a package put its executables?
> 
> If it's big then   /opt/<big-package>/bin/
>   and add that dir to the path with   /etc/profile.d/<big-package>.sh
> 
> If it's tiny          /usr/local/bin/
> 
> If it's middling then maybe  /opt/(small-package>/bin/
>   with a full set of soft links in  /usr/local/bin
> 
> But the upshot is a lot of  /usr/local/bin/
>   dirs with generations of un-traceable cruft.
> 
> Is there any way to have sub-dirs included in the path?
> 
> export PATH='~/.bin:opt/bin/*:/usr/bin:/bin'

What about something like:

PATH=~/bin
PATH="$PATH:/usr/local/bin:/usr/bin:/bin"
PATH="$PATH:$(find /opt/bin -type d -printf "%p:")"
export PATH

With appropriate finessing to match your requirements.

Yours Tony

  linux.conf.au        http://linux.conf.au/ || http://lca2008.linux.org.au/
  Jan 28 - Feb 02 2008 The Australian Linux Technical Conference!



More information about the linux mailing list