Tuesday, December 1, 2015

Replacing a line from a file with a terminal or shell command

Once again, sed(1) does the trick:
# sed -i '/foo/c\goo' bar.txt

No comments:

Post a Comment