[LBo] Re: PATH
Eric Archer
ericarcher at aol.com
Tue Nov 7 02:27:17 CET 2006
Dave Lerner wrote:
> jisao wrote on 11/05/2006 07:37 PM:
>> If your $PATH is lost in BASH, how do you restore the default one
>> (without exiting the shell)?
>
> Here's one way:
>
> $ bin/bash
> $ echo $PATH
>
> Save the output of the above command, e.g. in the clipboard.
>
> $ exit
> $ PATH=(output saved above)
>
Well I have tried the above instructions and got the following:
ericarcher at linux:~> echo $PATH
blah
ericarcher at linux:~> /bin/bash
bash: dircolors: command not found
bash: grep: command not found
bash: grep: command not found
ericarcher at linux:~> echo $PATH
blah
I had some bright ideas below that failed miserably.
ericarcher at linux:~> /etc/bash.bashrc
bash: /etc/bash.bashrc: Permission denied
ericarcher at linux:~> su
bash: su: command not found
ericarcher at linux:~> /bin/su
Password:
bash: dircolors: command not found
bash: grep: command not found
bash: grep: command not found
linux:/home/ericarcher # /etc/bash.bashrc
bash: /etc/bash.bashrc: Permission denied
linux:/home/ericarcher #
It seems that the PATH is generated from the /etc/profile. That file is
way over my head.
Is there a way to get the PATH back without exiting and restarting?
More information about the QnA
mailing list