如何使用 su 在 shell 脚本中传递密码(不带 sudo 和 except)?我试过 echo "password" | su root -c 。但它不起作用。
shell sudo su
shell ×1
su ×1
sudo ×1