I am on a mac and I am trying to set up a cron task to remove all instances of the '#' from my /etc/hosts file
I use this command:
sed 's/\#//g' /etc/hosts
which seems to work fine, but when I do this to output it to replace the content in /etc/hosts:
sed 's/\#//g' /etc/hosts > /etc/hosts
the /etc/hosts file ends up being empty. Why is it ending up empty?