代码之家  ›  专栏  ›  技术社区  ›  jon077

强制运行基本配置文件

  •  1
  • jon077  · 技术社区  · 17 年前

    我从sh shell开始:shell=/bin/sh

    我键入bash以启动bash shell,然后必须键入。bash_配置文件以加载我的配置文件。是否有一种方法可以设置为自动加载配置文件?

    4 回复  |  直到 17 年前
        1
  •  2
  •   janneb    17 年前

    . ~/.bash_剖面图

    在~/.bashrc中(注意无限循环!)。我自己不使用它,因为我在.bashrc中有很多东西(除了env.stuff等等)。

        2
  •  1
  •   Douglas Leeder    17 年前

    .bash_profile 仅用于登录shell,对于非登录shell(如您的),bash使用 .bashrc .

    对你来说,最简单的事情就是添加 . .bash_profile 给你 .

        3
  •  1
  •   Nietzche-jou    17 年前

    跑步 这样会导致它的来源 /etc/bash.bashrc 然后 ~/.bashrc 代替 .bash_简介 (和其他文件)。因此,把 . ~/.bash_profile 在里面 ,(或 /etc/bash.bashrc

        4
  •  0
  •   Alex Reynolds    17 年前

    档案 .bash_profile .bashrc 从非登录会话运行bash时运行。

    尝试将此添加到您的 :

    source ~/.bash_profile