在Ubuntu10.04和14.04上,我在userdel实用程序的行为上遇到了微小的差异,现在我正在努力修复它。我有一种“强化”脚本,应该删除用户通过userdel实用程序。但改变这一点将是最后的选择,因为这将导致无数的管理者飞来飞去,争论行为为何会改变……在Ubuntu10.04但在ubuntu14.04上,结果看上去略有不同:
userdel: user administrator is currently used
echo -n "Please enter the username you'd like to delete: "passwd --lock $usernamesudo userdel -r "$username" >> /etc/sudoers.d/sugroup
我知道我可能需要将最后一行移到最后一个userdel -r行的上方
这是我迄今为止最好的尝试的一个片段: send "userdel $userdel_username\r"
timeout { send_user "timeout on deletion=exist).*\$" { set userdel_fail 1;} # easy way to check for the error}
if {$userdel</em