<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Bash Script for Replace Multiple Words in a Multiple File</title>
	<atom:link href="http://vavai.net/2010/01/07/bash-script-for-replace-multiple-words-in-a-multiple-file/feed/" rel="self" type="application/rss+xml" />
	<link>http://vavai.net/2010/01/07/bash-script-for-replace-multiple-words-in-a-multiple-file/</link>
	<description>Masim "Vavai" Sugianto Personal Blog</description>
	<lastBuildDate>Wed, 28 Jul 2010 22:37:22 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Masim "Vavai" Sugianto</title>
		<link>http://vavai.net/2010/01/07/bash-script-for-replace-multiple-words-in-a-multiple-file/comment-page-1/#comment-24707</link>
		<dc:creator>Masim "Vavai" Sugianto</dc:creator>
		<pubDate>Fri, 15 Jan 2010 04:38:26 +0000</pubDate>
		<guid isPermaLink="false">http://vavai.net/?p=977#comment-24707</guid>
		<description>@Pascal,

Thank you. I&#039;m not really familiar with Perl but I would love to try your code. :-)</description>
		<content:encoded><![CDATA[<p>@Pascal,</p>
<p>Thank you. I&#8217;m not really familiar with Perl but I would love to try your code. <img src='http://vavai.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pascal Bleser</title>
		<link>http://vavai.net/2010/01/07/bash-script-for-replace-multiple-words-in-a-multiple-file/comment-page-1/#comment-24034</link>
		<dc:creator>Pascal Bleser</dc:creator>
		<pubDate>Thu, 07 Jan 2010 15:56:19 +0000</pubDate>
		<guid isPermaLink="false">http://vavai.net/?p=977#comment-24034</guid>
		<description>As Diego already said, it is a lot easier to use the &quot;-i&quot; in-place editing flag, because it does it properly (locking, really temporary/random filename, ...). If not, it is a lot safer to use &quot;mktemp&quot; instead of a fixed filename.

But be aware that those &quot;words&quot; are actually regular expressions, and that you cannot use e.g. &quot;/&quot; in the word to be replaced or the replacement.

I would rather resort to Perl, because it has the ability to escape complete strings in regular expressions. Oh, and Perl also has the -i flag :)

perl -pi -e &#039;s/\Qword1\E/\Qreplacement1\E/g;s/\Qword2\E/\Qreplacement2\E/g&#039; file1 file2 file3</description>
		<content:encoded><![CDATA[<p>As Diego already said, it is a lot easier to use the &#8220;-i&#8221; in-place editing flag, because it does it properly (locking, really temporary/random filename, &#8230;). If not, it is a lot safer to use &#8220;mktemp&#8221; instead of a fixed filename.</p>
<p>But be aware that those &#8220;words&#8221; are actually regular expressions, and that you cannot use e.g. &#8220;/&#8221; in the word to be replaced or the replacement.</p>
<p>I would rather resort to Perl, because it has the ability to escape complete strings in regular expressions. Oh, and Perl also has the -i flag <img src='http://vavai.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>perl -pi -e &#8216;s/\Qword1\E/\Qreplacement1\E/g;s/\Qword2\E/\Qreplacement2\E/g&#8217; file1 file2 file3</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vavai</title>
		<link>http://vavai.net/2010/01/07/bash-script-for-replace-multiple-words-in-a-multiple-file/comment-page-1/#comment-24024</link>
		<dc:creator>Vavai</dc:creator>
		<pubDate>Thu, 07 Jan 2010 12:04:19 +0000</pubDate>
		<guid isPermaLink="false">http://vavai.net/?p=977#comment-24024</guid>
		<description>Hi Diego,

Thanks for the suggestion.</description>
		<content:encoded><![CDATA[<p>Hi Diego,</p>
<p>Thanks for the suggestion.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Diego E. "Flameeyes" Pettenò</title>
		<link>http://vavai.net/2010/01/07/bash-script-for-replace-multiple-words-in-a-multiple-file/comment-page-1/#comment-24021</link>
		<dc:creator>Diego E. "Flameeyes" Pettenò</dc:creator>
		<pubDate>Thu, 07 Jan 2010 10:52:58 +0000</pubDate>
		<guid isPermaLink="false">http://vavai.net/?p=977#comment-24021</guid>
		<description>On modern GNU sed (that is, from at least the last five years) – and you&#039;re already assuming GNU sed when you use multiple -e parameters – you can use the -i parameter to do &quot;inline replace&quot;. 

This way you don&#039;t have to copy the file to a temporary version and then back again for the replacement, nor you really need to grep for the string: just use sed -i -e &#039;...&#039; -e &#039;...&#039; /list/of/files/*.foo</description>
		<content:encoded><![CDATA[<p>On modern GNU sed (that is, from at least the last five years) – and you&#8217;re already assuming GNU sed when you use multiple -e parameters – you can use the -i parameter to do &#8220;inline replace&#8221;. </p>
<p>This way you don&#8217;t have to copy the file to a temporary version and then back again for the replacement, nor you really need to grep for the string: just use sed -i -e &#8216;&#8230;&#8217; -e &#8216;&#8230;&#8217; /list/of/files/*.foo</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->