easy string replacement
Posted: Wed Nov 22, 2017 9:06 am
I needed to change one string in all the conkies, and didn't want to open the scripts one at a time. Googled the problem as "bash replace string many files," and came upon a description on how to use the Debian package rpl.
Installed that, opened a terminal in ~/.conky, and ran this after reading the man page:
--the -R tells the program to run recursively so it will cover all subfolders
--I had to use quotes around the string I wanted to replace (I read) because it contained a space
--All our conkies start with the same prefix (after I made a few changes...), so I could use MX-* to include them.
That appears to have worked just fine, and is much easier for me than figuring out the syntax of sed, the command that is usually recommended.
Installed that, opened a terminal in ~/.conky, and ran this after reading the man page:
Code: Select all
rpl -R "override_utf8_locale no" "override_utf8_locale yes" MX-*
--I had to use quotes around the string I wanted to replace (I read) because it contained a space
--All our conkies start with the same prefix (after I made a few changes...), so I could use MX-* to include them.
That appears to have worked just fine, and is much easier for me than figuring out the syntax of sed, the command that is usually recommended.