Re: Issues updating the host files

Richard - VE7CVS

sudo curl -o DPlus_Hosts.txt

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

sudo bash -s "curl > 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

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

Join to automatically receive all group messages.