Livid
408.2D
531.92D
V2EX  ›  macOS

貌似 Mac OS X 下 sudo su root 的时候不会执行 /etc/bashrc,原因是什么呢?

  •  
  •   Livid ·
    PRO
    · Jun 20, 2012 · 4614 views
    This topic created in 5279 days ago, the information mentioned may be changed or developed.
    1 replies  •  1970-01-01 08:00:00 +08:00
    skyahead
    skyahead
    Jun 20, 2012
    1
    The main difference is that /etc/bashrc is not automatically read under any circumstance. The only way it gets included (say in ~/.bashrc), is if it's referenced in your ~/.bashrc file with something like:

    if [ -f /etc/bashrc ] ; then
    . /etc/bashrc
    fi

    /etc/profile is read automatically only if you are loginning in.


    Stole from: http://www.linuxquestions.org/questions/linux-general-1/etc-profile-v-s-etc-bashrc-273992/#post1403475
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2398 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 12:46 · PVG 20:46 · LAX 04:46 · JFK 07:46
    ♥ Do have faith in what you're doing.