<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Question XX=? Answer OO=m : xxOOm.com &#187; bash</title>
	<atom:link href="http://www.xxoom.com/oo/bash/feed" rel="self" type="application/rss+xml" />
	<link>http://www.xxoom.com</link>
	<description>-</description>
	<lastBuildDate>Tue, 13 Sep 2011 21:19:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Remove Text from Multiple Files</title>
		<link>http://www.xxoom.com/linux/remove-text-from-multiple-files</link>
		<comments>http://www.xxoom.com/linux/remove-text-from-multiple-files#comments</comments>
		<pubDate>Thu, 18 Feb 2010 20:39:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[multiple]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://www.xxoom.com/?p=48</guid>
		<description><![CDATA[Shell script to remove some text from multiple files Here is a small script that reads all *.txt  or all *.html, all *.php  files and delete all lines between word1 and word2: #!/bin/bash FILES="*.php" for f in $FILES do INF="$f" OUTF="$f.out.tmp" # replace sed '/word1/,/word2>/d' $INF > $OUTF /bin/cp $OUTF $INF /bin/rm -f $OUTF done [...]]]></description>
			<content:encoded><![CDATA[<h3>Shell script to remove some text from multiple files</h3>
<p>Here is a small script that reads all *.txt  or all *.html, all *.php  files and delete all lines between word1 and word2:</p>
<blockquote><p><code>#!/bin/bash<br />
FILES="*.php"<br />
for f in $FILES<br />
do<br />
INF="$f"<br />
OUTF="$f.out.tmp"<br />
# replace<br />
sed '/word1/,/word2>/d' $INF > $OUTF<br />
/bin/cp $OUTF $INF<br />
/bin/rm -f $OUTF<br />
done</code></p></blockquote>
<p>Then save this file as &#8220;myscript.txt&#8221;</p>
<p>run this script with: # bash myscript.txt</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Bookmark It</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://buzz.yahoo.com/submit?submitUrl=http://www.xxoom.com/linux/remove-text-from-multiple-files&amp;submitHeadline=Remove+Text+from+Multiple+Files&amp;submitSummary=" rel="nofollow" title="Add to&nbsp;Buzz"><img class="social_img" src="http://www.xxoom.com/wp-content/plugins/social-bookmarks/images/buzz.png" title="Add to&nbsp;Buzz" alt="Add to&nbsp;Buzz" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://www.xxoom.com/linux/remove-text-from-multiple-files&amp;title=Remove+Text+from+Multiple+Files" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.xxoom.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://www.xxoom.com/linux/remove-text-from-multiple-files&amp;title=Remove+Text+from+Multiple+Files" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.xxoom.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http://www.xxoom.com/linux/remove-text-from-multiple-files" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.xxoom.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http://www.xxoom.com/linux/remove-text-from-multiple-files&amp;title=Remove+Text+from+Multiple+Files" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.xxoom.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.mister-wong.com/index.php?action=addurl&amp;bm_url=http://www.xxoom.com/linux/remove-text-from-multiple-files&amp;bm_description=Remove+Text+from+Multiple+Files" rel="nofollow" title="Add to&nbsp;Mister Wong"><img class="social_img" src="http://www.xxoom.com/wp-content/plugins/social-bookmarks/images/misterwong.png" title="Add to&nbsp;Mister Wong" alt="Add to&nbsp;Mister Wong" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.netscape.com/submit/?U=http://www.xxoom.com/linux/remove-text-from-multiple-files&amp;T=Remove+Text+from+Multiple+Files" rel="nofollow" title="Add to&nbsp;Netscape"><img class="social_img" src="http://www.xxoom.com/wp-content/plugins/social-bookmarks/images/netscape.png" title="Add to&nbsp;Netscape" alt="Add to&nbsp;Netscape" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://www.xxoom.com/linux/remove-text-from-multiple-files&amp;title=Remove+Text+from+Multiple+Files" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.xxoom.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit.php?url=http://www.xxoom.com/linux/remove-text-from-multiple-files&amp;title=Remove+Text+from+Multiple+Files" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.xxoom.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http://www.xxoom.com/linux/remove-text-from-multiple-files" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.xxoom.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://tipd.com/submit.php?url=http://www.xxoom.com/linux/remove-text-from-multiple-files" rel="nofollow" title="Add to&nbsp;Tip'd"><img class="social_img" src="http://www.xxoom.com/wp-content/plugins/social-bookmarks/images/tipd.png" title="Add to&nbsp;Tip'd" alt="Add to&nbsp;Tip'd" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://twitter.com/home/?status=Check+out+Remove+Text+from+Multiple+Files+@+http://www.xxoom.com/linux/remove-text-from-multiple-files" rel="nofollow" title="Add to&nbsp;Twitter"><img class="social_img" src="http://www.xxoom.com/wp-content/plugins/social-bookmarks/images/twitter.png" title="Add to&nbsp;Twitter" alt="Add to&nbsp;Twitter" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://myweb2.search.yahoo.com/myresults/bookmarklet?u=http://www.xxoom.com/linux/remove-text-from-multiple-files&amp;t=Remove+Text+from+Multiple+Files" rel="nofollow" title="Add to&nbsp;Yahoo My Web"><img class="social_img" src="http://www.xxoom.com/wp-content/plugins/social-bookmarks/images/yahoo.png" title="Add to&nbsp;Yahoo My Web" alt="Add to&nbsp;Yahoo My Web" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
]]></content:encoded>
			<wfw:commentRss>http://www.xxoom.com/linux/remove-text-from-multiple-files/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

