What are privilege differences between sudo and sudo -i?
With sudo
it's
$sudo echo "search foo.bar.baz" >> /etc/resolv.conf
bash: /etc/resolv.conf: Permission denied
...and with sudo -i
$sudo -i
#echo "search foo.bar.baz" >> /etc/resolv.conf
...it works. The privileges are:
drwxr-xr-x 166 root root 12288 2009-10-17 21:02 .
-rw-r--r-- 1 root root 42 2009-10-17 20:55 /etc/resolv.conf
I was a surprise that these commands have different behavior, what causes the just sudo
version to fail?