Re: Issues updating the host files
Richard - VE7CVS
sudo curl -o DPlus_Hosts.txt http://ar-dns.net/dplus-gwtoggle quoted messageShow quoted text
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.