我想在没有交互的情况下执行以下命令:
sudo grep -e "test" /etc/sudoers
我尝试了以下方法:
tester@compute:~$ echo 'clouduser' | sudo -S grep -e "test" /etc/sudoers
[sudo] password for tester: test ALL=(ALL) NOPASSWD: ALL
问题是我得到[sudo] password for tester:
了响应。我怎样才能从答案的前面剪掉那部分?
谢谢!