只在「登录交互式 shell」(login shell)时执行
/etc/profile 会去跑 /etc/profile.d/*.sh。
如果你用 su seed,默认启动的是 非登录 shell,不会跑 /etc/profile,自然也不会加载 /etc/profile.d/conda.sh。
如果你用 su - seed(注意 -),这是登录 shell,就会加载 /etc/profile → /etc/profile.d/*.sh,PATH 就会更新。
只在「登录交互式 shell」(login shell)时执行
/etc/profile 会去跑 /etc/profile.d/*.sh。
如果你用 su seed,默认启动的是 非登录 shell,不会跑 /etc/profile,自然也不会加载 /etc/profile.d/conda.sh。
如果你用 su - seed(注意 -),这是登录 shell,就会加载 /etc/profile → /etc/profile.d/*.sh,PATH 就会更新。