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\sALL=(ALL)\sNOPASSWD:\s*ALL)/#\1/' /usr/local/etc/sudoers
sed: illegal option -- i
root on test:</tmp>
i have tried this also its also not working
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