Closed goodevilgenius closed 5 years ago
If we're using sudo throughout the script, then it shouldn't need to be run as root.
sudo
However, doing:
sudo echo something >> root-owned-file
doesn't work, since the redirect doesn't get the sudo.
So, to fix, we have to do:
echo something | sudo tee -a root-owned-file
If we're using
sudo
throughout the script, then it shouldn't need to be run as root.However, doing:
doesn't work, since the redirect doesn't get the sudo.
So, to fix, we have to do: