bash - 为什么 ~/.bash_profile 不起作用?

标签 bash

我正在使用 Linux Mint。我的登录 shell (cat/etc/passwd | grep myUserName) 是 bash。

在我启动我的图形桌面环境并从中运行终端模拟器后,我可以看到 .bash_profile 不是源代码(其中 export 的环境变量未设置) .但是,如果我从文本控制台 (ctrl+alt+F1) 登录或从终端手动运行 bash -l模拟器,.bash_profile 工作正常。

当我认为 .bash_profile 应该在 X 启动时获取并且所有 export 的变量应该在终端中可用,从 X 运行时,我错了吗?

最佳答案

使用.bashrc代替.bash_profile

这里有一些解释: http://www.joshstaiger.org/archives/2005/07/bash_profile_vs.html

关于bash - 为什么 ~/.bash_profile 不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18350252/

相关文章:

python - 连接外显子序列并在其间插入 Ns

linux - Linux 中 while 循环的问题

bash - 使用终端的 VLC 屏幕捕获

bash - cmd START/D 和 nohup 的 bash 模拟是什么?

python - 在 Python 脚本中运行 bash 命令

linux - mail -s 在 bash 脚本中等待 CTRL+D

linux - 如何为每条记录添加标题到行

bash - 通过管道从 subshel​​l 获取退出代码

linux - 如何在 shell 脚本中使用 tee 和 sshpass

java - Shell 脚本无法启动 java 程序 [Debian]