From: Sheep on
I am trying to set the path in with adding lines in .bash_profile

if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
if [ -f ~/test.env ]; then
~/test.env
fi
PATH=$PATH:$HOME/bin
export PATH

Where test.env contains just a few of lines,

export TOOLCHAIN_PATH=/1234567
export PATH=${TOOLCHAIN_PATH}/bin:$PATH
echo PATH=${PATH}

The last line in test.env is to make sure the desired path is added in
every login. Actually, I got what I want when login as following text
is shown
PATH=/1234567/bin:/user/kerberos/bin:/user/local/bin:/bin:/usr/bin

However, when the prompt comes up, I type "set" to further check,
PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/shane/bin

Originally, the system work fine with the setting. I don't what
changes that sucks the system.

Can anyone give me some clues on this problem?
From: Martin Klar on
Sheep wrote:
> I am trying to set the path in with adding lines in .bash_profile
>
> if [ -f ~/.bashrc ]; then
> . ~/.bashrc
> fi
> if [ -f ~/test.env ]; then
> ~/test.env
> fi

maybe a
source ~/test.env
fix your problem.

"man bash":
source filename [arguments]
Read and execute commands from filename in the current shell environment
....­


HTH Martin
From: The Wizard of Oz on
Sheep wrote:
> I am trying to set the path in with adding lines in .bash_profile
>
> if [ -f ~/.bashrc ]; then
> . ~/.bashrc
> fi
> if [ -f ~/test.env ]; then
> ~/test.env
> fi
> PATH=$PATH:$HOME/bin
> export PATH
>
> Where test.env contains just a few of lines,
>
> export TOOLCHAIN_PATH=/1234567
> export PATH=${TOOLCHAIN_PATH}/bin:$PATH
> echo PATH=${PATH}
>
> The last line in test.env is to make sure the desired path is added in
> every login. Actually, I got what I want when login as following text
> is shown
> PATH=/1234567/bin:/user/kerberos/bin:/user/local/bin:/bin:/usr/bin
>
> However, when the prompt comes up, I type "set" to further check,
> PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/shane/bin
>
> Originally, the system work fine with the setting. I don't what
> changes that sucks the system.
>
> Can anyone give me some clues on this problem?

Here is a possible solution...

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/opt/schily/bin:/usr/local/lib:./

export PATH
unset USERNAME
From: Daniel Ganek on
Sheep wrote:
> I am trying to set the path in with adding lines in .bash_profile
>
> if [ -f ~/.bashrc ]; then
> . ~/.bashrc
> fi
> if [ -f ~/test.env ]; then
> ~/test.env
> fi
> PATH=$PATH:$HOME/bin
> export PATH
>
> Where test.env contains just a few of lines,
>
> export TOOLCHAIN_PATH=/1234567
> export PATH=${TOOLCHAIN_PATH}/bin:$PATH
> echo PATH=${PATH}
>
> The last line in test.env is to make sure the desired path is added in
> every login. Actually, I got what I want when login as following text
> is shown
> PATH=/1234567/bin:/user/kerberos/bin:/user/local/bin:/bin:/usr/bin
>
> However, when the prompt comes up, I type "set" to further check,
> PATH=/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/home/shane/bin
>
> Originally, the system work fine with the setting. I don't what
> changes that sucks the system.
>
> Can anyone give me some clues on this problem?

You're executing ~/test.env not sourcing it. Change the line to

. ~/test.env

/dan