you cant directly edit the file sudoers file with cat >> /etc/sudoers or echo "blah blah" >>/etc/sudoers not even with sudo permissions because the redirection is carried out by the shell and by then the permissions will be dropped.
however if you are doing this with script, you can run
"echo "blah blah" >>/etc/sudoers" with sudo <scriptname.sh>
evo2's method is better:
using visudo -c -f /etc/sudoers.temp
can validate the temp file and then you can replace it.