Page 1 of 1

easy string replacement

Posted: Wed Nov 22, 2017 9:06 am
by Jerry3904
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:

Code: Select all

rpl -R "override_utf8_locale no" "override_utf8_locale yes" MX-*
--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.

Re: easy string replacement

Posted: Wed Nov 22, 2017 9:32 am
by cyrilus31
It's great that you succeded Jerry :number1:

How many conky themes do you intend to provide out of the box?

Re: easy string replacement

Posted: Wed Nov 22, 2017 9:52 am
by Jerry3904
Just trying now to correct the B2 collection, and will probably eliminate a few for Final.

The goal was to set up conky out of the box, develop a tool to make modifications easier, and to provide decent documentation. That has been mostly done now.

Re: easy string replacement

Posted: Wed Nov 22, 2017 4:15 pm
by Stevo
Re: rpl viewtopic.php?f=86&t=43063&p=424292&hilit=rpl#p424292 :happy:

Yes, it is quite useful and powerful!

Re: easy string replacement

Posted: Wed Nov 22, 2017 5:08 pm
by Jerry3904
Oh sorry, that message was buried in a thread and I never saw it.