[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bash Path Duplications: An idea from zsh

From: Chet Ramey
Subject: Re: Bash Path Duplications: An idea from zsh
Date: Thu, 3 Jan 2002 08:39:07 -0500

> There has been considerable recent discussion on the redhat-list
> regarding path setting in Red Hat Linux and therefore in bash, their
> default shell.  The discussion centers around the common event of
> multiple instances of the same directory(s) within path entries, flowing
> in part from multiple invocations of bash startup files.  A common work
> around is conditional appendages to PATH, based on echo | grep tests.  Some
> discussants find this inelegant and seek a better way to do this.

This is so trivial to do with shell functions that it's not worth
putting into the shell proper.  Look at examples/functions/pathfuncs
in the bash distribution for guidance.

The `case' statement and the [[...]] conditional command are your friends.
There should be no need to resort to `echo | grep' tests.

``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]