I give up. How do I get this to work:
sudo echo "Line of text" > /etc/directory-where-I-dont-have-write-permission/filename
The idea is to have a shell script run as sudo create the file filename with the contents Line of text in a directory that requires root permission to write. By itself, this line does not work, as the sudo doesn't span the redirect.
sudo echo "Line of text" > /etc/directory-where-I-dont-have-write-permission/filename
The idea is to have a shell script run as sudo create the file filename with the contents Line of text in a directory that requires root permission to write. By itself, this line does not work, as the sudo doesn't span the redirect.
Comment