V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
answerbob
V2EX  ›  问与答

mac 每次都要 source profile?

  •  
  •   answerbob · Mar 3, 2014 · 9677 views
    This topic created in 4443 days ago, the information mentioned may be changed or developed.
    我想添加我export 的环境变量,为什么每次启动终端都要source /etc/profile 才生效,看网上所要~/.bash_profile ~/.bashrc 也弄了 依然不生效啊
    6 replies    2016-01-06 17:26:10 +08:00
    hexor
        1
    hexor  
       Mar 3, 2014   ❤️ 1
    vi ~/.bash_profile

    把环境变量都放到这个文件里就好了. 其他的统统不需要.

    另外. 如果你使用了其他终端工具比如Fish等, 就要参照工具的手册来设置环境变量了.
    winsky027
        2
    winsky027  
       Mar 3, 2014   ❤️ 1
    vi /etc/bashrc
    answerbob
        3
    answerbob  
    OP
       Mar 3, 2014
    @hexor
    @winsky027
    还是不行啊 我用的zsh
    alexrezit
        5
    alexrezit  
       Mar 3, 2014   ❤️ 1
    zsh 不用 zshrc 用 bashrc 能管用?
    ljp
        6
    ljp  
       Jan 6, 2016
    如果用的是 zsh , 需要修改 ~/.zshrc 这个文件才会生效的。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2448 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 08:23 · PVG 16:23 · LAX 01:23 · JFK 04:23
    ♥ Do have faith in what you're doing.