小编ach*_*lle的帖子

debian 交互式 shell 不调用 .profile

我刚刚安装了一个全新的 debian buster:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:    10
Codename:   buster
Run Code Online (Sandbox Code Playgroud)
$ cat /etc/profile
 [..]
if [ "`id -u`" -eq 0 ]; then
  PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
else
  PATH="/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
fi
export PATH

[...]
Run Code Online (Sandbox Code Playgroud)
$ whoami 
zozo
$ su 
Password:
# id -u 
0
# printenv | grep -i ^path 
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
Run Code Online (Sandbox Code Playgroud)

如果我以 root 身份运行:

  • # grep -i path /etc/profile.d/* 没有输出
  • # grep -i path ~/.profile 没有输出
  • # grep -i path ~/.bashrc 没有输出 …

bash environment-variables

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

标签 统计

bash ×1

environment-variables ×1