0
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
pandi
  • 7
  • 3
  • Possible duplicate of [sed -i + what the same option in SOLARIS](http://stackoverflow.com/questions/3576380/sed-i-what-the-same-option-in-solaris) – fpietka Feb 06 '17 at 10:59
  • i want to comment unix entry through scrit # cat /usr/local/etc/sudoers |grep -i unix unix ALL=(ALL) NOPASSWD: ALL root on test: #sed -i + 's/^\s*\(unix\s*ALL=(ALL)\s*NOPASSWD:\s*ALL\)/#\1/' /usr/local/etc/sudoers sed: illegal option -- i root on test: – pandi Feb 06 '17 at 11:58
  • i want to comment unix entry through script # cat /usr/local/etc/sudoers |grep -i unix unix ALL=(ALL) NOPASSWD: ALL root on test: #sed -i + 's/^\s*\(unix\s*ALL=(ALL)\s*NOPASSWD:\s*ALL\)/#\1/' /usr/local/etc/sudoers sed: illegal option -- i root on test: i am getting illegal option error – pandi Feb 06 '17 at 12:00

0 Answers0