如何使新添加的PATH长期有效?

View: New views
5 Messages — Rating Filter:   Alert me  

如何使新添加的PATH长期有效?

by Arthur Wong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

各位好!

需要将一个新的path添加到$PATH之中,已经添加到 ~/.bash_profile 之中了,然后执行"source ~/.bash_profile"使之生效,但好像每次机器重启后都得执行一次,否则就找不到了,请问该如果使设置长期有效昵?

系统:Debian Lenny

Parent Message unknown Re: 如何使新添加的PATH长期有效?

by Arthur Wong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

好的,感谢。

Btw:~/.bashrc 与 ~/.bash_profile 有什么区别,各自的职责是什么?

2008/8/27 LI Daobing (李道兵) <lidaobing@...>
2008/8/27 Arthur Wong <wzc0066@...>:
> 各位好!
>
> 需要将一个新的path添加到$PATH之中,已经添加到 ~/.bash_profile 之中了,然后执行"source
> ~/.bash_profile"使之生效,但好像每次机器重启后都得执行一次,否则就找不到了,请问该如果使设置长期有效昵?
>
> 系统:Debian Lenny
>

~/.bashrc


--
Best Regards,
 LI Daobing


Parent Message unknown Re: 如何使新添加的PATH长期有效?

by Arthur Wong :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

好的,基本明白了,这些细节平时还真没怎么注意,非常感谢。

2008/8/27 LI Daobing (李道兵) <lidaobing@...>
2008/8/27 Arthur Wong <wzc0066@...>:
> 好的,感谢。
>
> Btw:~/.bashrc 与 ~/.bash_profile 有什么区别,各自的职责是什么?

你从终端/SSH登录时(一个新的login),bash 会 source ~/.bash_profile, ~/.bash_profile
可能会 source ~/.bashrc
你从gdm/xdm/... 登录后再运行 xterm/gnome-terminal/... 时,产生一个假登录,只 source ~/.bashrc

具体名词我都忘记了,以上的名词都是瞎说的


--
Best Regards,
 LI Daobing


Re: 如何使新添加的PATH长期有效?

by shell909090 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Arthur Wong 写道:

> 好的,基本明白了,这些细节平时还真没怎么注意,非常感谢。
>
> 2008/8/27 LI Daobing (李道兵) <lidaobing@...
> <mailto:lidaobing@...>>
>
>     2008/8/27 Arthur Wong <wzc0066@... <mailto:wzc0066@...>>:
>     > 好的,感谢。
>     >
>     > Btw:~/.bashrc 与 ~/.bash_profile 有什么区别,各自的职责是什么?
>
>     你从终端/SSH登录时(一个新的login),bash 会 source ~/.bash_profile,
>     ~/.bash_profile
>     可能会 source ~/.bashrc
>     你从gdm/xdm/... 登录后再运行 xterm/gnome-terminal/... 时,产生一个
>     假登录,只 source ~/.bashrc
>
>     具体名词我都忘记了,以上的名词都是瞎说的
>
>
>     --
>     Best Regards,
>      LI Daobing
>
>
好久前我测试过,当时还是这样的。
http://shell909090.spaces.live.com/blog/cns!7AD2FCE74833C21B!1079.entry


--
To UNSUBSCRIBE, email to debian-chinese-gb-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Re: 如何使新添加的PATH长期有效?

by 刘勇泰 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

~/.bash_profile是在Bash做为login shell(比如在tty登录)时运行的。
而做为非login shell(比如在x系统下用终端模拟器)时,Bash运行的是
~/.bashrc。

在 2008-08-27三的 10:05 +0800,Arthur Wong写道:
> 各位好!
>
> 需要将一个新的path添加到$PATH之中,已经添加到 ~/.bash_profile 之中了,
> 然后执行"source ~/.bash_profile"使之生效,但好像每次机器重启后都得执行
> 一次,否则就找不到了,请问该如果使设置长期有效昵?
>
> 系统:Debian Lenny
>


--
To UNSUBSCRIBE, email to debian-chinese-gb-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...

LightInTheBox - Buy quality products at wholesale price!