如何实现自动执行此操作而不在每次循环时都要求输入密码?
#!/bin/sh
for k in 2 3 5 10; do
sudo ldconfig ######## # password asking here everytime
python experiments.py
done
答案1
以 sudo 身份运行脚本:sudo ./script
如何实现自动执行此操作而不在每次循环时都要求输入密码?
#!/bin/sh
for k in 2 3 5 10; do
sudo ldconfig ######## # password asking here everytime
python experiments.py
done
以 sudo 身份运行脚本:sudo ./script