[sudo-users] crontab modification using sudo

Todd C. Miller Todd.Miller at courtesan.com
Mon Jul 9 11:44:36 EDT 2007


vi is a screen editor; you'd be better off using ex or ed.
Personally I tend to use ed for such simple tasks.
Also, your regex replacement is incorrect.

EDITOR="/usr/bin/ex -" /usr/local/bin/sudo crontab -e tabstst<<EOF
1,$g/^.*$script11/s//#&/
wq!
EOF

 - todd



More information about the sudo-users mailing list