Originally posted by: Casey_B
A better method of doing what you asked:
cat sudoers | awk
'/ADMIN ALL/{print $0 "SU,SUT";next} NR==8{print "New Lines Blah Blah\nOther new line"} {print}'
But in my opinion, this only fixes your current scenario, but doesn't make it easier for the next time
you have to make sudoers changes.
This also doesn't verify your sudoers file to make sure that no mistakes happened in the editing.
If you have many systems, you may want to reconsider how you manage your sudoers file.
Maybe a methodology where you have one file as the master, check and recheck it there, and then distribute it
to other nodes.
You can make permissions depend on hosts.
It would make it more complicated to maintain sudoers than it would be on a single machine, but it would be less
complicated than trying to awk, or sed new changes to a number of files.
Good luck, Hope this helps.
Casey