Reputation: 714
I've just been writing some code, that renders a locale property redundant. Because of that, I'd like it to be able to remove that property from every locale file of the project, but I simply couldn't find a way of doing that, and I ended up doing it by hand in vim.
Now, I'm no UNIX black-belt, but I know that there must be a pretty simple solution to such a trivial problem, probably hidden in the depths of sed
or awk
. So I managed to match the property (the property being no_outline
):
sed -e '/no_outline=/d' l10n/*/viewer.properties
But this only prints out the contents of each file, without the no_outline
line. Isn't it possible to write the "result" of the sed
command to the same file as it was executed on?
Upvotes: 0
Views: 87
Reputation: 195049
you could:
sed -i '/no_outline=/d' l10n/*/viewer.properties
from man page:
-i[SUFFIX], --in-place[=SUFFIX]
edit files in place (makes backup if SUFFIX supplied)
Upvotes: 2