庆典/ Cygwin的/ $ PATH:我真的要重新启动,以改变$ PATH? [英] bash/cygwin/$PATH: Do I really have to reboot to alter $PATH?

查看:243
本文介绍了庆典/ Cygwin的/ $ PATH:我真的要重新启动,以改变$ PATH?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用在cygwin下而不是一个直接的WinXP下安装安装了Python,所以我编辑的〜/ .bashrc和采购它。没有改变。我尝试过其他的东西,但没有我没有以任何方式改变$ PATH。所以,我重新启动。啊哈;现在$ PATH已更改为我想要的东西。

I wanted to use the Python installed under cygwin rather than one installed under WinXP directly, so I edited ~/.bashrc and sourced it. Nothing changed. I tried other things, but nothing I did changed $PATH in any way. So I rebooted. Aha; now $PATH has changed to what I wanted.

但是,任何人都可以解释为什么会发生?什么时候通过的cygwin(和bash)向环境的变化(及其变量)只有在重新启动之后才能生效?

But, can anyone explain WHY this happened? When do changes to the environment (and its variables) made via cygwin (and bash) take effect only after a reboot?

(这是没有办法运行的铁路?)(这个问题是不可能赢得任何积分,但我很好奇,我也厌倦了通过文档不就这点帮助涉水)。

(Is this any way to run a railroad?) (This question is unlikely to win any points, but I'm curious, and I'm also tired of wading through docs which don't help on this point.)

推荐答案

尝试:

PATH="${PATH}:${PYTHON}"; export PATH

或者

export PATH="${PATH}:${PYTHON}"

报价preserve你的空格和换行的在你的目录名。我再说一遍

the quotes preserve the spaces and newlines that you don't have in your directory names. I repeat "don't".

如果你想改变当前的环境和任何后续进程的路径,使用类似上述两种命令的东西;它们是等效的。

If you want to change the path for the current environment and any subsequent processes, use something similar to either of the commands above; they are equivalent.

如果你想改变你开始猛砸,编辑〜/ .bashrc中并添加一个以上(例如),或编辑现有的下一次路径 PATH ,你发现有设置命令。

If you want to change the path for the next time you start Bash, edit ~/.bashrc and add one of the above (for example) or edit the existing PATH setting command that you find there.

如果你想既影响当前的环境和任何后续的(即有立竿见影的和永久影响),编辑〜/ .bashrc中和做一操作:类型的上述〜/ .bashrc中文件显示的前两种形式之一。有时候,你可能不希望做采购,举个例子,它会撤消你正在做的目前有喜欢的设置不同于〜/ .bashrc中将设置(复位)他们。

If you want to affect both the current environment and any subsequent ones (i.e. have an immediate and a "permanent" affect), edit ~/.bashrc and do one of the following: type one of the first two forms shown above or source the ~/.bashrc file. Sometimes, you may not want to do the sourcing if, for example, it would undo some temporary thing that you're making use of currently like have some other variables set differently than ~/.bashrc would set (reset) them to.

我不认为你需要担心的哈希,除非你要么做一些严重的重新排列或添加系统工具或许一些地方的替代品。

I don't think you need to worry about hash unless you're either doing some serious rearranging or adding some local replacements for system utilities perhaps.

这篇关于庆典/ Cygwin的/ $ PATH:我真的要重新启动,以改变$ PATH?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆