[CentOS] what provices replace command?
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 -- Kind Regards Rudi Ahlers SoftDux Website: http://www.SoftDux.com Technical Blog: http://Blog.SoftDux.com Office: 087 805 9573 Cell: 082 554 7532 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] what provices replace command?
On Sat, Jan 9, 2010 at 5:47 AM, Rudi Ahlers r...@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 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] what provices replace command?
On Sat, Jan 9, 2010 at 3:55 PM, Akemi Yagi amy...@gmail.com wrote: On Sat, Jan 9, 2010 at 5:47 AM, Rudi Ahlers r...@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. -- Kind Regards Rudi Ahlers SoftDux Website: http://www.SoftDux.com Technical Blog: http://Blog.SoftDux.com Office: 087 805 9573 Cell: 082 554 7532 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] what provices replace command?
2010/1/9 Rudi Ahlers r...@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=chromeie=UTF-8q=sed+replace+strings Ben ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] what provices replace command?
On Sat, Jan 09, 2010 at 04:05:44PM +0200, Rudi Ahlers wrote: On Sat, Jan 9, 2010 at 3:55 PM, Akemi Yagi amy...@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 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] what provices replace command?
On Sat, Jan 9, 2010 at 4:17 PM, Stephen Harris li...@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 amy...@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. -- Kind Regards Rudi Ahlers SoftDux Website: http://www.SoftDux.com Technical Blog: http://Blog.SoftDux.com Office: 087 805 9573 Cell: 082 554 7532 ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] what provices replace command?
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. -- MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] what provices replace command?
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 -- Get your web at Conactive Internet Services: http://www.conactive.com ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Re: [CentOS] what provices replace command?
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 KP obviously which is one of the must-have *nix books :-). I still use the original KP 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 -- INTERNET: b...@celestial.com Bill Campbell; Celestial Software LLC URL: http://www.celestial.com/ PO Box 820; 6641 E. Mercer Way Voice: (206) 236-1676 Mercer Island, WA 98040-0820 Fax:(206) 232-9186 Skype: jwccsllc (206) 855-5792 Just because you do not take an interest in politics doesn't mean politics won't take an interest in you. -- Pericles : replace: replace str1 in files with str2, in place # PATH=:/bin:/usr/bin:/csrel25/bin # . /csrel25/etc/csspath# sets path for local system case $# in 0|1|2) echo 'Usage: replace str1 str2 files' 12; exit 1 esac left=$1; right=$2; shift; shift for i do if [ -s $i ] then overwrite $i sed s...@$left@$ri...@g $i fi done : overwrite:copy standard input to output after EOF : final version opath=$PATH case $# in 0|1)echo 'Usage: overwrite file cmd [args]' 12; exit 2 esac file=$1; shift new=/tmp/overwr1.$$; old=/tmp/overwr2.$$ : clean up on interrupt trap 'rm -f $new $old; exit 1' 1 2 15 : collect input if PATH=$opath $@ $new then cp $file $old trap '' 1 2 15 cp $new $file else echo overwrite: $1 failed, $file unchanged 12 exit 1 fi rm -f $new $old ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos