我有一个用 sudo -- 调用的脚本,我sudo script希望能够看到运行该脚本的用户的用户名(不是 root)。
sudo script
坚持whoami或id -un在脚本内只是给我root。
whoami
id -un
root
bash
bash ×1