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

Re: How to add dir to path



Hi Mike,

On 8/7/07, Mike McCarty <Mike.McCarty@sbcglobal.net> wrote:

>>$ export PATH=~/scripts:$PATH

<SNIP>

Well, I combined two commands into one.

$ x=y
sets an environment variable x to value y.
$ export x
makes x available to all subprocesses in the tree which get created
after the export.

$ export x=y

does both at the same time.

Thanks for explaining. To be honest, I didn't notice.

 

> I just found out that if I add my dir to /etc/profile it's available every
> time.

Umm, not where I would have put it. That affects every user.
I'd put it into ~/.bash_profile because I use bash. That way
it would affect only me. If another user doesn't use bash as
his shell, then he'll break.

Others also advised against modifying /etc/profile. So I reset it
to its original state and placed export PATH=~/scripts:$PATH
at the end of ~/.bash_profile. All works well now.

Thanks, Manon.


Reply to: