Re: Issues updating the host files


Richard - VE7CVS
 

sudo curl -o DPlus_Hosts.txt http://ar-dns.net/dplus-gw

should also work. John is correct, the redirect is not part of the privileged command. Another workaround is:

sudo bash -s "curl http://ar-dns.net/dplus-gw > DPlus_Hosts.txt"

which puts the entire command into a subshell, including the redirect. Be careful with the form though, as quoting can be tricky for some commands.

- Richard, VE7CVS

I think the problem is that while sudo curl is running privileged once the redirect ">" is encountered it is no longer privileged.  In this case wget is probably better.

sudo wget -O DPlus_Hosts.txt http://ar-dns.net/dplus-gw

Since wget is opening the file, it is running under the 'sudo' privileges.  

Join udrc@nw-digital-radio.groups.io to automatically receive all group messages.