Quick and easy file write as root
While I was switching from rvm
to rbenv
I removed the system Ruby as part of it and, for a few moments had a vim
refusing duty since it relied on the ruby .so
library which wasn't there anymore and I wanted to write something without too much effort as root:
sudo su -c 'cat <<eof > /etc/locale.conf
LANG=en_US.UTF-8
LC_COLLATE=C
eof'
Did just the trick. It has the convenience of heredocs, so its a nice editing experience in bash as well (of course my zle is superior, but that's another story ;)
Written by Rob Jentzema
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Zsh
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#