11 Mar
2012
11 Mar
'12
20:56
On Sunday 11 March 2012 15:27:25 David C. Rankin wrote:
Guys,
I have an interesting question. I have a file that I need to append information to that is owned by root. Initially I wanted to use echo:
sudo echo "X" >> y.txt
sudo bash -c "echo X >> y.txt" works. Or you can put the whole thing in a script and just do sudo script.sh
sudo sed -i '/\/custompkgs/s#$#\n\n[local]\nServer = file:///repo\n#' $CHROOT/root/etc/repo.conf
How can I omit searching for a word and just tell sed to append at end of file?
~> cat foo foo ~> sed -ie '$a \bar' foo ~> cat foo foo bar Anders -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org