【发布时间】:2020-09-11 14:38:41
【问题描述】:
我想在不交互的情况下执行以下命令:
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: 。
我怎样才能从答案的前面剪掉那部分?
谢谢!
【问题讨论】:
标签: bash command non-interactive