3 ms·
sudo curl https://github.com/art-dot-git/80x40/blob/master/README https://github.com/art-dot-git/80x40/blob/master/README > /etc/motd
by jlebrech 11y ago
sudo curl https://github.com/art-dot-git/80x40/blob/master/README https://github.com/art-dot-git/80x40/blob/master/README > /etc/motd
- raimue 11y agoThis won't work. You only elevate the privileges of the curl process, while the redirected output was opened by your shell beforehand. curl https://github.com/art-dot-git/80x40/blob/master/README | sudo tee /etc/motd >/dev/null
- jwilk 11y agoYou didn't actually try it, did you? :> It should be: sudo curl -L https://github.com/art-dot-git/80x40/raw/master/README https://github.com/art-dot-git/80x40/raw/master/README -o /etc/motd
- jlebrech 11y agoyeah I wouldn't run that, the content of that url looks nasty. any chance it could buffer override the motd command?
- steeef 11y agoHere's yet another way: sudo bash -c 'curl https://github.com/art-dot-git/80x40/blob/master/README > /etc/motd'