我只是想弄清楚谁调用了 root 或 sudo,因为我不想在 root 的主文件夹中设置一些东西,当我在终端中尝试它时它的工作完美,但不适用于规范,我做错了什么?
终端:
[Mcfly@Mcfly ~]$ whoami=$(who am i | awk '{print $1}')
[Mcfly@Mcfly ~]$ echo $whoami
Mcfly
规格
%define whoami %(who am i | awk '{print $1}')
echo "The user that built this is %{whoami}"
the user that built this is '%{whoami}'
你能帮助我吗 ?
或者有一种简单的方法可以了解 rpm-spec 中的用户路径,我的意思是 /home/mcfly/ 没有 /root?
问候