[CentOS] replace multiple string
madunix at gmail.com
madunix at gmail.comFri Sep 23 17:47:12 UTC 2011
- Previous message: [CentOS] Building custom installation media
- Next message: [CentOS] replace multiple string
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi I would like to use a bash script that searches files and subdirectories name in a directory /var/ww/html/web for a specific string, and when it finds the search string, replaces the string (old1) with new string (new1), and so on old2 with new2 ....oldn with newn. replace_string.sh #!/bin/bash for db in $(find /var/www/html/web -name * -exec) do sed -e "s/old1/new1/" \ sed -e "s/old2/new2/" \ ... sed -e "s/oldn/newn/" $db done Any recommendation.. Thanks pons
- Previous message: [CentOS] Building custom installation media
- Next message: [CentOS] replace multiple string
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list