I am attempting to write a script that will comment out the following line in /etc/sudoers every time I launch a new EC2 instance:
Defaults requiretty
I'm assuming the best way to do this is with an inline sed search and replace or search and insert. The issue is there could be 1+ spaces/tabs between Defaults and requiretty also. What's an efficient sed solution?
Best Answer
Jay's answer will work almost unchanged with
sed
: