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

Re: safe way to set a path



Wichert Akkerman <wichert@wiggy.net> wrote:

> A better approach would be to set IFS to : and loop over the PATH entries
> and see if one matches with the directory you want to add.

The original message said that this is for a script.  But why would you
bother checking for this if it's just going to be used while the script
is running? It doesn't hurt to have the same directory in the PATH twice.

Of course if the script did some sort of recursive calls to itself, that
would be a different story.
-- 
Debian GNU/Linux 2.2 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



Reply to: