小编bit*_*bit的帖子

如何设置路径,以便可以通过同一程序从 GUI 和命令行读取它?

我安装了 texlive,我想将其作为环境变量添加到我的 Path 中,以便当我从 GUI 或命令行启动 emacs 时,Emacs AucTeX 可以读取它。到目前为止,我已经了解到 emacs 只读取来自~/.profile.

因此,我的计划是将 texlive 添加到我的路径中,.profile以使 emacs GUI 能够读取它,然后~/profile从中获取源代码.bashrc,以便在我的非登录交互式 GNOME 终端中启动的 emacs 查看路径。

.profile注意:我的主目录中没有文件,仅在我的/etc目录中,我不想碰那个文件,但我.bash_profile的主目录中有一个文件。但是我读到它.bash_profile仅针对交互式登录会话(即我不使用的控制台模式)运行。

我的计划是在我的主目录中创建一个.profile文件并执行以下操作:

第 1 步:创建~/.profile

步骤2:将texlive环境变量添加到path中.profile

export PATH=/usr/local/texlive/2018/bin/x86_64-linux:$PATH
export MANPATH=/usr/local/texlive/2018/texmf-dist/doc/man:$MANPATH
export INFOPATH=/usr/local/texlive/2018/texmf-dist/doc/info:$INFOPATH
Run Code Online (Sandbox Code Playgroud)

步骤 3:.profile来源.bashrc

#Adding this at the bottom or start of .bashrc to source .profile when the terminal is opened.

if [-s ~/.profile]; then;
    source …
Run Code Online (Sandbox Code Playgroud)

bash emacs .profile environment-variables bashrc

5
推荐指数
1
解决办法
2194
查看次数

标签 统计

.profile ×1

bash ×1

bashrc ×1

emacs ×1

environment-variables ×1