需要帮助通过脚本

时间:2017-02-06 10:56:25

标签: shell unix scripting

When i am trying in solaris its throughing the below error 

#cat / usr / local / etc / sudoers | grep -i unix   unix ALL =(ALL)NOPASSWD:ALL  root on test:

sed -i -e's / ^ \ s *(unix \ s ALL =(ALL)\ s NOPASSWD:\ s * ALL)/#\ 1 /'/ usr / local的/ etc / sudoers的

sed: illegal option -- i
root on test:</tmp>

我已经尝试了这个也没有用

root on test: </tmp>
$ sudo perl -pi -e 's/^\s*\(unix\s*ALL=(ALL)\s*NOPASSWD:\s*ALL\)/#\1/' /usr/local/etc/sudoers

root on test: </tmp>
cat /usr/local/etc/sudoers |grep -i unix
unix   ALL=(ALL) NOPASSWD: ALL


sed -i -e 's/^\s*\(unix\s*ALL=(ALL)\s*NOPASSWD:\s*ALL\)/#\1/' /usr/local/etc/sudoers but the same script is working on linux

0 个答案:

没有答案