I am used to using the replace command to quickly replace strings in file, but it's not available on some of my fresh CentOS 5.4 servers.
"yum info replace", "yum whatprovides replace", and "yum search replace" doesn't show me which package(s) to install to get it. So, does anyone know which package to install to get the "replace" command?
Google doesn't help either since the work "replace" is too common
Results 1 - 10 of about 5,440,000 for how to install "replace" command on linux
On Sat, Jan 9, 2010 at 5:47 AM, Rudi Ahlers Rudi@softdux.com wrote:
I am used to using the replace command to quickly replace strings in file, but it's not available on some of my fresh CentOS 5.4 servers.
"yum info replace", "yum whatprovides replace", and "yum search replace" doesn't show me which package(s) to install to get it. So, does anyone know which package to install to get the "replace" command?
Try:
yum whatprovides "*/replace"
Akemi
On Sat, Jan 9, 2010 at 3:55 PM, Akemi Yagi amyagi@gmail.com wrote:
On Sat, Jan 9, 2010 at 5:47 AM, Rudi Ahlers Rudi@softdux.com wrote:
I am used to using the replace command to quickly replace strings in file, but it's not available on some of my fresh CentOS 5.4 servers.
"yum info replace", "yum whatprovides replace", and "yum search replace" doesn't show me which package(s) to install to get it. So, does anyone know which package to install to get the "replace" command?
Try:
yum whatprovides "*/replace"
Akemi _______________________________________________
I already tried that as well :) No luck.
On Sat, Jan 09, 2010 at 04:05:44PM +0200, Rudi Ahlers wrote:
On Sat, Jan 9, 2010 at 3:55 PM, Akemi Yagi amyagi@gmail.com wrote:
yum whatprovides "*/replace"
I already tried that as well :) No luck.
On my CentOS 5 machine:
% yum whatprovides '*/replace' Loaded plugins: priorities 470 packages excluded due to repository priority protections mysql-server-5.0.77-3.el5.i386 : The MySQL server and related files Matched from: Filename : /usr/bin/replace
mysql-server-5.0.77-4.el5_4.1.i386 : The MySQL server and related files Matched from: Filename : /usr/bin/replace
Either you did it wrong or your repository information isn't correct.
(I've no idea if that's the right "replace" command, but it's _a_ replace command!)
On Sat, Jan 9, 2010 at 4:17 PM, Stephen Harris lists@spuddy.org wrote:
On Sat, Jan 09, 2010 at 04:05:44PM +0200, Rudi Ahlers wrote:
On Sat, Jan 9, 2010 at 3:55 PM, Akemi Yagi amyagi@gmail.com wrote:
yum whatprovides "*/replace"
I already tried that as well :) No luck.
On my CentOS 5 machine:
% yum whatprovides '*/replace' Loaded plugins: priorities 470 packages excluded due to repository priority protections mysql-server-5.0.77-3.el5.i386 : The MySQL server and related files Matched from: Filename : /usr/bin/replace
mysql-server-5.0.77-4.el5_4.1.i386 : The MySQL server and related files Matched from: Filename : /usr/bin/replace
Either you did it wrong or your repository information isn't correct.
(I've no idea if that's the right "replace" command, but it's _a_ replace command!)
--
rgds Stephen _______________________________________________
Ok, so I'm not the only one who's getting this :)
In this case, I suspect the repository is incorrect, or it's not in a common repository ? OR, is it actually part of MySQL? This particular server already has MySQL installed, but replace isn't there.
Rudi Ahlers wrote on Sat, 9 Jan 2010 17:47:29 +0200:
In this case, I suspect the repository is incorrect, or it's not in a common repository ? OR, is it actually part of MySQL? This particular server already has MySQL installed, but replace isn't there.
Wow, I've never heard of it, but, yes, it's there. And it comes with mysql-server.
Kai
2010/1/9 Rudi Ahlers Rudi@softdux.com:
I am used to using the replace command to quickly replace strings in file, but it's not available on some of my fresh CentOS 5.4 servers.
Is sed suitable for what you need to achieve?
http://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=sed+replac...
Ben
On Sat, 2010-01-09 at 15:47 +0200, Rudi Ahlers wrote:
I am used to using the replace command to quickly replace strings in file, but it's not available on some of my fresh CentOS 5.4 servers.
If you just want to do what you say here, sed will work fine.
I remember that I had, found, or quite possibly wrote a "replace" command for DOS that I used to find quite handy but sed comes with Linux so that's all that is required.
On Sat, Jan 09, 2010, Rudi Ahlers wrote:
I am used to using the replace command to quickly replace strings in file, but it's not available on some of my fresh CentOS 5.4 servers.
"yum info replace", "yum whatprovides replace", and "yum search replace" doesn't show me which package(s) to install to get it. So, does anyone know which package to install to get the "replace" command?
Google doesn't help either since the work "replace" is too common
The original replace command that I used for years was from the Kernighan and Pike ``Unix Programming Environment'', and is a simple shcll script that uses their ``overwrite'' command to safely edit a file in place. The command syntax is:
replace old new file [file ...]
MySQL created their own replace command that has different arguments and calling sequence (not having read K&P obviously which is one of the must-have *nix books :-). I still use the original K&P version, renamed ``csreplace'' to avoid conflicts with the mysql version. I've attached the csreplace and overwrite scripts which can be put someplace in PATH.
A *MUCH* more flexible tool that can be used for editing in place is Ralf Engelschall's shtool script available here:
ftp://ftp.gnu.org/gnu/shtool/
GNU shtool is a compilation of small but very stable and portable shell scripts into a single shell tool. All ingredients were in successful use over many years in various free software projects. The compiled shtool script is intended to be used inside the source tree of those free software packages. There it can take over various (usually non-portable) tasks related to the building and installation of such packages.
The only problem I've found with shtool's subst option is that giving it a bad ``sed'' command results in zero length file(s) so it's a good idea to test complex substitutions.
Bill