I am trying to automate the addition of a repository source in my arch\'s pacman.conf file but using the echo command in my shell script. However, it fails like th
The problem is that the redirection is being processed by your original shell, not by sudo. Shells are not capable of reading minds and do not know that that particular >> is meant for the sudo and not for it.
You need to:
sudo) sudo -s (so that sudo uses a shell to process the quoted redirection.)