<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.1" -->
<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/"
	>

<channel>
	<title>Segmentation Fault: Core dumped..;-)</title>
	<link>http://indrayam.com</link>
	<description>Anand Sharma's weblog: A peek into life through "my" bioscope</description>
	<pubDate>Tue, 11 Nov 2008 16:24:46 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.1</generator>
        <image> 
           <title>Segmentation Fault: Core dumped..;-)</title> 
           <url>http://indrayam.com/images/favicon.gif</url>
           <link>http://indrayam.com</link>
        </image>
	<language>en</language>
			<item>
		<title>HOWTO: Take a screenshot of a scrolling window</title>
		<link>http://indrayam.com/archives/how-do-i/000814.php</link>
		<comments>http://indrayam.com/archives/how-do-i/000814.php#comments</comments>
		<pubDate>Thu, 18 Nov 2004 18:50:34 +0000</pubDate>
		<dc:creator>anand</dc:creator>
		
		<category><![CDATA[How do I?]]></category>

		<guid isPermaLink="false">http://indrayam.com/?p=814</guid>
		<description><![CDATA[<p>
<center><a href="http://www.techsmith.com/products/snagit/default.asp" target="_blank"><img src="http://indrayam.com/images/techsmith-snagit.jpg" border="0"></a></center>
<p>
As IT professionals, there are plenty of times when we're asked to write technical documentations or presentations. Soon you start to realize that keyboard commands like <span id="code">'Print Screen'</span> or <span id="code">'Alt+Print Screen'</span> are indeed very handy tools to have at your disposal. However, if you've used these enough, you know that these keyboard commands are pretty limiting, especially when it comes to capturing things like:
<ul>
<li>Taking a 'complete' screenshot of a window which has a vertical scroll as it's too big to fit in a screen
<li>Capturing contextual drop-down menus (such as right-clicks)
<li>A freehand region (any region) of your desktop
</ul>
<p>
Enter TechSmith's <a href="http://www.techsmith.com/products/snagit/default.asp" target="_blank">SnagIt</a>. If you've 39 bucks to spare, <b>SnagIt</b> is a really handy tool to have. You can even take this for a test-drive for 30 days before putting a 39 dollar hole in your pocket.
<p>
Here are some samples of the amazing things I was able to do using this tool:
<p>
<center><img src="http://indrayam.com/images/news.com-small.png" border="1"><br clear="both"/><font size=-2>Taking a 'complete' screenshot of a window which<br/> has a vertical scroll as it's too big to fit<br/>in a screen</font></center>
<p>
<center><img src="http://indrayam.com/images/media-menu.png" border="1"><br clear="both"/><font size=-2>Capturing contextual drop-down menus<br/> (such as right-clicks)</font></center>
<p>
<center><img src="http://indrayam.com/images/system-tray.png" border="0"><br clear="both"/><font size=-2>A freehand region (any region) of my desktop (including cursor)</font></center>
<p>
I am sure this tool has plenty more surprises provided I give it the time that it deserves. However, the features listed above were enough to convince me that this tool deserved to have it's own special place in my IT toolkit, that is, until I lay my hands on a "free" alternative <img src="http://indrayam.com/images/wink.gif" align="middle">]]></description>
			<content:encoded><![CDATA[<p>
<center><a href="http://www.techsmith.com/products/snagit/default.asp" target="_blank"><img src="http://indrayam.com/images/techsmith-snagit.jpg" border="0"></a></center>
<p>
As IT professionals, there are plenty of times when we're asked to write technical documentations or presentations. Soon you start to realize that keyboard commands like <span id="code">'Print Screen'</span> or <span id="code">'Alt+Print Screen'</span> are indeed very handy tools to have at your disposal. However, if you've used these enough, you know that these keyboard commands are pretty limiting, especially when it comes to capturing things like:
<ul>
<li>Taking a 'complete' screenshot of a window which has a vertical scroll as it's too big to fit in a screen
<li>Capturing contextual drop-down menus (such as right-clicks)
<li>A freehand region (any region) of your desktop
</ul>
<p>
Enter TechSmith's <a href="http://www.techsmith.com/products/snagit/default.asp" target="_blank">SnagIt</a>. If you've 39 bucks to spare, <b>SnagIt</b> is a really handy tool to have. You can even take this for a test-drive for 30 days before putting a 39 dollar hole in your pocket.
<p>
Here are some samples of the amazing things I was able to do using this tool:
<p>
<center><img src="http://indrayam.com/images/news.com-small.png" border="1"><br clear="both"/><font size=-2>Taking a 'complete' screenshot of a window which<br/> has a vertical scroll as it's too big to fit<br/>in a screen</font></center>
<p>
<center><img src="http://indrayam.com/images/media-menu.png" border="1"><br clear="both"/><font size=-2>Capturing contextual drop-down menus<br/> (such as right-clicks)</font></center>
<p>
<center><img src="http://indrayam.com/images/system-tray.png" border="0"><br clear="both"/><font size=-2>A freehand region (any region) of my desktop (including cursor)</font></center>
<p>
I am sure this tool has plenty more surprises provided I give it the time that it deserves. However, the features listed above were enough to convince me that this tool deserved to have it's own special place in my IT toolkit, that is, until I lay my hands on a "free" alternative <img src="http://indrayam.com/images/wink.gif" align="middle">]]></content:encoded>
			<wfw:commentRss>http://indrayam.com/archives/how-do-i/000814.php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HOWTO: Capturing still images from Windows Media Player (8.x/9.x)</title>
		<link>http://indrayam.com/archives/how-do-i/000813.php</link>
		<comments>http://indrayam.com/archives/how-do-i/000813.php#comments</comments>
		<pubDate>Thu, 18 Nov 2004 18:08:53 +0000</pubDate>
		<dc:creator>anand</dc:creator>
		
		<category><![CDATA[How do I?]]></category>

		<guid isPermaLink="false">http://indrayam.com/?p=813</guid>
		<description><![CDATA[<p>
If you've ever tried capturing a still image from a Windows Media Player (WMP), you know it's not as simple as pressing <span id="code">'Print Screen'</span> or <span id="code">'Alt+Print Screen'</span> button while the movie is playing. If you've no clue what I am talking about, here's a little test you can run yourself.
<p>
<b>Assumptions:</b>
<p>
1. You're on a Windows platform<br/>
2. You've your browser configured with Windows Media Player (8.x/9.x) plugin<br/>
3. You're connected to the Internet
<p>
<b>Steps to perform the test:</b>
<p>
1. Open your favorite browser<br/>
2. You can go to your favorite multimedia site (<a href="http://music.msn.com" target="_blank">Music video site</a>, <a href="http://news.com" target="_blank">News.com</a> etc.) and play a movie using your WMP plugin or you can go to <a href="http://cbs.marketwatch.com" target="_blank">CBS MarketWatch</a>. Over to the right-hand side, you will notice a <b>TV & Radio</b> section with a bunch of movies to play. Pick one and when prompted for player preferences, select WMP.<br/>
3. When the movie starts playing, click on <span id="code">'Print Screen'</span> or <span id="code">'Alt+Print Screen'</span><br/>
4. Open Paint program from the Accessories folder of your Start Menu (<span id="code">'Start | Programs | Accessories | Paint'</span>) <br/>
5. Click on <span id="code">'Edit | Paste'</span> in the Paint program.
<p>
Do you see the problem? It literally embeds the movie (I guess as an OLE object) into the Paint software. <u>Result:</u> <b>You see the movie playing within Paint!</b>. Trying to close WMP or hit the pause button on WMP before taking a screenshot would really delay the inevitable. You would soon notice that the best that you can get is this:
<p>
<center><img src="http://indrayam.com/images/wmp-problem.jpg" border="0"></center>
<p>
<b>Solution:</b>
<p>
1. As soon as the Windows Media plugin loads in your browser and starts playing, hit pause, right-click on an empty region of the skin of the Windows Media player. You should see a drop-down menu similar to the one shown below. Even if it's not exactly same, as long as you see the <span id="code">'Options...'</span> menu option, you'll be fine:
<p>
<center><img src="http://indrayam.com/images/media-menu.png" border="0"></center>
<p>
2. Click on <span id="code">'Options...'</span> menu option which will open the <span id="code">Options</span> dialog window looking something like this:
<p>
<center><img src="http://indrayam.com/images/media-options-full.jpg" border="0"></center>
<p>
3. Notice the 'Video Acceleration' section. It's set to <span id="code">'Full'</span>. Drag the slider back so that it's set to <span id="code">'None'</span>. It should look like this:
<p>
<center><img src="http://indrayam.com/images/media-options-zero.jpg" border="0"></center>
<p>
4. Click on <span id="code">Apply</span>. You may have to close the browser window and do the whole thing again or if you're lucky, after churning your CPU cycles for a bit, the Windows Media player plugin will start playing the movie from the beginning with the new settings.
<p>
5. With the movie playing, click <span id="code">'Print Screen'</span> or <span id="code">'Alt+Print Screen'</span> at the point in the movie where you would like to capture a still image
<p>
6. Open the Paint program (as explained previously) and paste the content from the clipboard. Voila! The result would be something like:
<p>
<center><img src="http://indrayam.com/images/wmp-result.jpg" border="0"></center>
<p>
7. When you're done capturing your still image, do not forget to reset your WMP <span id="code">'Video Acceleration'</span> settings back to <span id="code">'Full'</span>. It's the recommended mode.
<p>
<div class="note">
<u>Note:</u><br/>
1. Microsoft seems to have fixed this problem in their latest version (Version 10.0) of Windows Media Player. Meaning, pressing the 'Print Screen' or the 'Alt+Print Screen' will capture the still image to the clipboard and pasting it in programs like 'Paint' would not cause the movie object itself to be embedded (or whatever the hell it was doing in 8.x/9.x).<br/>
2. Thanks to Mark Salloway's Resource Center for pointing <a href="http://www.mvps.org/marksxp/WindowsXP/wmp.php" target="_blank">this</a> issue (and the solution) out.
</div>]]></description>
			<content:encoded><![CDATA[<p>
If you've ever tried capturing a still image from a Windows Media Player (WMP), you know it's not as simple as pressing <span id="code">'Print Screen'</span> or <span id="code">'Alt+Print Screen'</span> button while the movie is playing. If you've no clue what I am talking about, here's a little test you can run yourself.
<p>
<b>Assumptions:</b>
<p>
1. You're on a Windows platform<br/>
2. You've your browser configured with Windows Media Player (8.x/9.x) plugin<br/>
3. You're connected to the Internet
<p>
<b>Steps to perform the test:</b>
<p>
1. Open your favorite browser<br/>
2. You can go to your favorite multimedia site (<a href="http://music.msn.com" target="_blank">Music video site</a>, <a href="http://news.com" target="_blank">News.com</a> etc.) and play a movie using your WMP plugin or you can go to <a href="http://cbs.marketwatch.com" target="_blank">CBS MarketWatch</a>. Over to the right-hand side, you will notice a <b>TV & Radio</b> section with a bunch of movies to play. Pick one and when prompted for player preferences, select WMP.<br/>
3. When the movie starts playing, click on <span id="code">'Print Screen'</span> or <span id="code">'Alt+Print Screen'</span><br/>
4. Open Paint program from the Accessories folder of your Start Menu (<span id="code">'Start | Programs | Accessories | Paint'</span>) <br/>
5. Click on <span id="code">'Edit | Paste'</span> in the Paint program.
<p>
Do you see the problem? It literally embeds the movie (I guess as an OLE object) into the Paint software. <u>Result:</u> <b>You see the movie playing within Paint!</b>. Trying to close WMP or hit the pause button on WMP before taking a screenshot would really delay the inevitable. You would soon notice that the best that you can get is this:
<p>
<center><img src="http://indrayam.com/images/wmp-problem.jpg" border="0"></center>
<p>
<b>Solution:</b>
<p>
1. As soon as the Windows Media plugin loads in your browser and starts playing, hit pause, right-click on an empty region of the skin of the Windows Media player. You should see a drop-down menu similar to the one shown below. Even if it's not exactly same, as long as you see the <span id="code">'Options...'</span> menu option, you'll be fine:
<p>
<center><img src="http://indrayam.com/images/media-menu.png" border="0"></center>
<p>
2. Click on <span id="code">'Options...'</span> menu option which will open the <span id="code">Options</span> dialog window looking something like this:
<p>
<center><img src="http://indrayam.com/images/media-options-full.jpg" border="0"></center>
<p>
3. Notice the 'Video Acceleration' section. It's set to <span id="code">'Full'</span>. Drag the slider back so that it's set to <span id="code">'None'</span>. It should look like this:
<p>
<center><img src="http://indrayam.com/images/media-options-zero.jpg" border="0"></center>
<p>
4. Click on <span id="code">Apply</span>. You may have to close the browser window and do the whole thing again or if you're lucky, after churning your CPU cycles for a bit, the Windows Media player plugin will start playing the movie from the beginning with the new settings.
<p>
5. With the movie playing, click <span id="code">'Print Screen'</span> or <span id="code">'Alt+Print Screen'</span> at the point in the movie where you would like to capture a still image
<p>
6. Open the Paint program (as explained previously) and paste the content from the clipboard. Voila! The result would be something like:
<p>
<center><img src="http://indrayam.com/images/wmp-result.jpg" border="0"></center>
<p>
7. When you're done capturing your still image, do not forget to reset your WMP <span id="code">'Video Acceleration'</span> settings back to <span id="code">'Full'</span>. It's the recommended mode.
<p>
<div class="note">
<u>Note:</u><br/>
1. Microsoft seems to have fixed this problem in their latest version (Version 10.0) of Windows Media Player. Meaning, pressing the 'Print Screen' or the 'Alt+Print Screen' will capture the still image to the clipboard and pasting it in programs like 'Paint' would not cause the movie object itself to be embedded (or whatever the hell it was doing in 8.x/9.x).<br/>
2. Thanks to Mark Salloway's Resource Center for pointing <a href="http://www.mvps.org/marksxp/WindowsXP/wmp.php" target="_blank">this</a> issue (and the solution) out.
</div>]]></content:encoded>
			<wfw:commentRss>http://indrayam.com/archives/how-do-i/000813.php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HOWTO: Renaming a group of files on your Linux machine</title>
		<link>http://indrayam.com/archives/how-do-i/000401.php</link>
		<comments>http://indrayam.com/archives/how-do-i/000401.php#comments</comments>
		<pubDate>Thu, 15 Jul 2004 21:45:47 +0000</pubDate>
		<dc:creator>anand</dc:creator>
		
		<category><![CDATA[How do I?]]></category>

		<guid isPermaLink="false">http://indrayam.com/?p=401</guid>
		<description><![CDATA[<p>
Found myself confronted with another pesky problem this morning.
<p>
<b>Goal:</b>
<blockquote>
<b>Rename a group of files in a folder (and possibly sub-folders)</b>
</blockquote>
<p>
<b>Example:</b>
<p>
You've a folder which has files looking like this:
<pre>
[user@myhost tmp]&gt; ls
test1.txt  test2.txt  test3.txt readme.txt
</pre>
Let's say you want to rename the files starting with <span id="code">test</span> as <span id="code">blah1.txt</span>, <span id="code">blah2.txt</span> and <span id="code">blah3.txt</span> respectively.
<p>
<b>Solution:</b>
<p>
<u>Approach 1: Using 'rename' command</u>
<p>
In RedHat distribution, there is a utility called <span id="code">rename</span>. You can use it as follows:
<pre>
[user@host tmp]&gt; ls
test1.txt  test2.txt  test3.txt readme.txt
[user@host tmp]&gt; <b>rename test blah test*.txt</b>
[user@host tmp]&gt; ls
blah1.txt  blah2.txt  blah3.txt readme.txt
</pre>
Basically, <span id="code">rename</span> will rename the specified files (<span id="code">test*.txt</span>) by replacing the <i>first occurrence</i> (and first occurence only) of <span id="code">test</span> in their name by <span id="code">blah</span>. In other words, the command-line parameters of <span id="code">rename</span> are:
<ol>
<li>pattern of the filename that needs to be replaced/changed (in our example, <span id="code">test</span>)
<li>pattern that #1 (found above) will be replaced with (in our example, <span id="code">blah</span>)
<li>all files that need to be considered for such renaming (in our example, files matching the pattern <span id="code">test*.txt</span>)
</ol>
<div class="note">
<u>Note:</u><br/>
I am not sure if there is a way for <span id="codeflow">'rename'</span> to traverse sub-folders as well. However, the shell script option below handles this limitation.
</div>
<p>
<u>Approach 2: Using a shell script</u>
<p>
In case you don't have the <span id="code">rename</span> utility on your flavor of Linux/Unix, you can use this simple bash script:
<pre>
#!/bin/bash

for cur in $(find . -name 'test*.txt'); do
   new=`echo $cur | sed 's/test/blah/'`
   mv $cur $new
done
</pre>
<p>
The advantage here is that this will traverse the sub-folders as well (unlike <span id="code">rename</span>).]]></description>
			<content:encoded><![CDATA[<p>
Found myself confronted with another pesky problem this morning.
<p>
<b>Goal:</b>
<blockquote>
<b>Rename a group of files in a folder (and possibly sub-folders)</b>
</blockquote>
<p>
<b>Example:</b>
<p>
You've a folder which has files looking like this:
<pre>
[user@myhost tmp]&gt; ls
test1.txt  test2.txt  test3.txt readme.txt
</pre>
Let's say you want to rename the files starting with <span id="code">test</span> as <span id="code">blah1.txt</span>, <span id="code">blah2.txt</span> and <span id="code">blah3.txt</span> respectively.
<p>
<b>Solution:</b>
<p>
<u>Approach 1: Using 'rename' command</u>
<p>
In RedHat distribution, there is a utility called <span id="code">rename</span>. You can use it as follows:
<pre>
[user@host tmp]&gt; ls
test1.txt  test2.txt  test3.txt readme.txt
[user@host tmp]&gt; <b>rename test blah test*.txt</b>
[user@host tmp]&gt; ls
blah1.txt  blah2.txt  blah3.txt readme.txt
</pre>
Basically, <span id="code">rename</span> will rename the specified files (<span id="code">test*.txt</span>) by replacing the <i>first occurrence</i> (and first occurence only) of <span id="code">test</span> in their name by <span id="code">blah</span>. In other words, the command-line parameters of <span id="code">rename</span> are:
<ol>
<li>pattern of the filename that needs to be replaced/changed (in our example, <span id="code">test</span>)
<li>pattern that #1 (found above) will be replaced with (in our example, <span id="code">blah</span>)
<li>all files that need to be considered for such renaming (in our example, files matching the pattern <span id="code">test*.txt</span>)
</ol>
<div class="note">
<u>Note:</u><br/>
I am not sure if there is a way for <span id="codeflow">'rename'</span> to traverse sub-folders as well. However, the shell script option below handles this limitation.
</div>
<p>
<u>Approach 2: Using a shell script</u>
<p>
In case you don't have the <span id="code">rename</span> utility on your flavor of Linux/Unix, you can use this simple bash script:
<pre>
#!/bin/bash

for cur in $(find . -name 'test*.txt'); do
   new=`echo $cur | sed 's/test/blah/'`
   mv $cur $new
done
</pre>
<p>
The advantage here is that this will traverse the sub-folders as well (unlike <span id="code">rename</span>).]]></content:encoded>
			<wfw:commentRss>http://indrayam.com/archives/how-do-i/000401.php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HOWTO: Performing global search and replace across files on your Linux machine</title>
		<link>http://indrayam.com/archives/how-do-i/000361.php</link>
		<comments>http://indrayam.com/archives/how-do-i/000361.php#comments</comments>
		<pubDate>Tue, 06 Jul 2004 21:40:07 +0000</pubDate>
		<dc:creator>anand</dc:creator>
		
		<category><![CDATA[How do I?]]></category>

		<guid isPermaLink="false">http://indrayam.com/?p=361</guid>
		<description><![CDATA[<p>
<div class="note">
<u>Version History:</u><br/>
<b>Date:</b> 07/06/2004<br/>
<b>Version:</b> 0.3<br/> 
<b>Notes:</b> Edited the entry to add a version showing how to parse files in sub-folders as well. Thanks to Wei (see comments below) for pointing this out.
<p>
<u>Version History:</u><br/>
<b>Date:</b> 07/06/2004<br/>
<b>Version:</b> 0.2<br/> 
<b>Notes:</b> Edited the entry to seperate out two solutions - Bash/Sed based and Perl based. Thanks to MS (see comments below) for pointing this out.
<p>
<b>Date:</b> 07/06/2004<br/>
<b>Version:</b> 0.1<br/>
<b>Notes:</b> Original post
</div>
<p>
Was assigned a simple task this morning: 
<p>
<pre>
...
&lt;a href="http://indrayam.com"&gt;Back to Home&lt;/a&gt;                      
&lt;/body&gt;
&lt;/html&gt;
</pre>
There are lots of files in a directory that have a pattern similar to the one shown above. My assignment was to replace the URL in the <span id="code">href</span> entries with a new one.
<p>
Sounds like a fairly common and simple problem. However, I soon realized that I did not have a canned utility or shell script that I could quickly use. After some googling around, here's what I came up with:
<p>
<b>Bash/Sed version:</b>
<p>
<pre>
#!/bin/bash

for i in $( ls *.html ); do    
   sed "s/\"http:\/\/indrayam.com\"/\"http:\/\/indrayam.com\/it\/\"/g" $i &gt; $i.new
   mv -f $i.new $i
done
</pre>
<p>
If you want to peruse through content a few levels deep, try this:
<pre>
#!/bin/bash

for i in $( find . -name '*.html' ); do   
   sed "s/\"http:\/\/indrayam.com\"/\"http:\/\/indrayam.com\/it\/\"/g" $i &gt; $i.new
   mv -f $i.new $i
done
</pre>
<p>
Here are a few pointers, in case you do decide on using the script:
<ol>
<li>For starters, restrict the <span id="code">$(ls *.&lt;file-extension&gt;)</span> section of the shell script to a single file by replacing it with <span id="code">$(ls &lt;filename&gt;)</span>. In other words, test the script out on a single file first.<p></p>
<li>Always run the <i>"double-whammy"</i> test - <b>Run the shell script once and then run the script again without any modifications!</b>. If the targetted file looks ok after this double execution, you have wisely selected your <span id="code">initial-pattern</span> and <span id="code">new-pattern</span> in sed's <span id="code">s/&lt;initial-pattern&gt;/&lt;new-pattern&gt;/g</span> expression. 
<p>
For example, let's say the <i>sed</i> expression in the shell script shown above looked something like this instead:
<p>
<pre>
sed "s/http:\/\/indrayam.com/http:\/\/indrayam.com\/it\//g" $i &gt; $i.new
</pre>
<p>
Do you see a problem here? Since our <span id="code">initial-pattern</span> is now <span id="code">http://indrayam.com</span> (as opposed to <span id="code">"http://indrayam.com"</span> in the shell script above), executing the script against the same file twice will result in <span id="code">href</span> looking something like:
<p>
<pre>
&lt;a href="http://indrayam.com/it//it/"&gt;Back to Home&lt;/a&gt; 
</pre>
<p>
Of course, this <i>double-whammy</i> problem will bite you primarily if your <span id="code">initial-pattern</span> is a subset of the <span id="code">new-pattern</span>
<li>Only after you've tested for these two things should you consider opening up the spigot by resetting <span id="code">$(ls &lt;filename&gt;)</span> to <span id="code">$(ls *.&lt;file-extension&gt;)</span>
</ol>
<p>
<div class="note">
<u>Note:</u><br/>
If you're looking for a backup of the original file, you might want to tweak the shell script above as follows:<br/>
<pre>
#!/bin/bash

for i in $( ls *.html ); do
   cp $i $i.bak
   sed "s/\"http:\/\/indrayam.com\"/\"http:\/\/indrayam.com\/it\/\"/g" $i &gt; $i.new
   mv -f $i.new $i
done
</pre>
</ul>
</div>
<p>
<b>Perl One-liner:</b>
<p>
If you like Perl, here's a <i>really, really</i> neat one-liner:<br>
<pre>
(unix prompt)&gt;perl -i.bak -p -e 's#"http://indrayam\.com"#"http://indrayam\.com/it/"#ig' *.html
</pre>
<p>
If you want to peruse through content a few levels deep, try this:
<pre>
(unix prompt)&gt;perl -i.bak -p -e 's#"http://indrayam\.com"#"http://indrayam\.com/it/"#ig' {.,*,*/*,*/*/*}/*.html
</pre>
<i>Nice!</i> 
<p>
For more information, check out this <a href="http://www.rice.edu/web/perl-edit.html" target="_blank">site</a> Thanks to MS (see comments below) for pointing this out.
<p>
<div class="note">
<u>Note:</u><br/>
The last perl one-liner example shown above will parse files in current dir and all subdirs <u>three</u> levels deep. I am not sure what would be the easiest way to parse files at an undefined depth level using perl one-liner without making it insanely cryptic. Any ideas?
</div>]]></description>
			<content:encoded><![CDATA[<p>
<div class="note">
<u>Version History:</u><br/>
<b>Date:</b> 07/06/2004<br/>
<b>Version:</b> 0.3<br/> 
<b>Notes:</b> Edited the entry to add a version showing how to parse files in sub-folders as well. Thanks to Wei (see comments below) for pointing this out.
<p>
<u>Version History:</u><br/>
<b>Date:</b> 07/06/2004<br/>
<b>Version:</b> 0.2<br/> 
<b>Notes:</b> Edited the entry to seperate out two solutions - Bash/Sed based and Perl based. Thanks to MS (see comments below) for pointing this out.
<p>
<b>Date:</b> 07/06/2004<br/>
<b>Version:</b> 0.1<br/>
<b>Notes:</b> Original post
</div>
<p>
Was assigned a simple task this morning: 
<p>
<pre>
...
&lt;a href="http://indrayam.com"&gt;Back to Home&lt;/a&gt;                      
&lt;/body&gt;
&lt;/html&gt;
</pre>
There are lots of files in a directory that have a pattern similar to the one shown above. My assignment was to replace the URL in the <span id="code">href</span> entries with a new one.
<p>
Sounds like a fairly common and simple problem. However, I soon realized that I did not have a canned utility or shell script that I could quickly use. After some googling around, here's what I came up with:
<p>
<b>Bash/Sed version:</b>
<p>
<pre>
#!/bin/bash

for i in $( ls *.html ); do    
   sed "s/\"http:\/\/indrayam.com\"/\"http:\/\/indrayam.com\/it\/\"/g" $i &gt; $i.new
   mv -f $i.new $i
done
</pre>
<p>
If you want to peruse through content a few levels deep, try this:
<pre>
#!/bin/bash

for i in $( find . -name '*.html' ); do   
   sed "s/\"http:\/\/indrayam.com\"/\"http:\/\/indrayam.com\/it\/\"/g" $i &gt; $i.new
   mv -f $i.new $i
done
</pre>
<p>
Here are a few pointers, in case you do decide on using the script:
<ol>
<li>For starters, restrict the <span id="code">$(ls *.&lt;file-extension&gt;)</span> section of the shell script to a single file by replacing it with <span id="code">$(ls &lt;filename&gt;)</span>. In other words, test the script out on a single file first.<p></p>
<li>Always run the <i>"double-whammy"</i> test - <b>Run the shell script once and then run the script again without any modifications!</b>. If the targetted file looks ok after this double execution, you have wisely selected your <span id="code">initial-pattern</span> and <span id="code">new-pattern</span> in sed's <span id="code">s/&lt;initial-pattern&gt;/&lt;new-pattern&gt;/g</span> expression. 
<p>
For example, let's say the <i>sed</i> expression in the shell script shown above looked something like this instead:
<p>
<pre>
sed "s/http:\/\/indrayam.com/http:\/\/indrayam.com\/it\//g" $i &gt; $i.new
</pre>
<p>
Do you see a problem here? Since our <span id="code">initial-pattern</span> is now <span id="code">http://indrayam.com</span> (as opposed to <span id="code">"http://indrayam.com"</span> in the shell script above), executing the script against the same file twice will result in <span id="code">href</span> looking something like:
<p>
<pre>
&lt;a href="http://indrayam.com/it//it/"&gt;Back to Home&lt;/a&gt; 
</pre>
<p>
Of course, this <i>double-whammy</i> problem will bite you primarily if your <span id="code">initial-pattern</span> is a subset of the <span id="code">new-pattern</span>
<li>Only after you've tested for these two things should you consider opening up the spigot by resetting <span id="code">$(ls &lt;filename&gt;)</span> to <span id="code">$(ls *.&lt;file-extension&gt;)</span>
</ol>
<p>
<div class="note">
<u>Note:</u><br/>
If you're looking for a backup of the original file, you might want to tweak the shell script above as follows:<br/>
<pre>
#!/bin/bash

for i in $( ls *.html ); do
   cp $i $i.bak
   sed "s/\"http:\/\/indrayam.com\"/\"http:\/\/indrayam.com\/it\/\"/g" $i &gt; $i.new
   mv -f $i.new $i
done
</pre>
</ul>
</div>
<p>
<b>Perl One-liner:</b>
<p>
If you like Perl, here's a <i>really, really</i> neat one-liner:<br>
<pre>
(unix prompt)&gt;perl -i.bak -p -e 's#"http://indrayam\.com"#"http://indrayam\.com/it/"#ig' *.html
</pre>
<p>
If you want to peruse through content a few levels deep, try this:
<pre>
(unix prompt)&gt;perl -i.bak -p -e 's#"http://indrayam\.com"#"http://indrayam\.com/it/"#ig' {.,*,*/*,*/*/*}/*.html
</pre>
<i>Nice!</i> 
<p>
For more information, check out this <a href="http://www.rice.edu/web/perl-edit.html" target="_blank">site</a> Thanks to MS (see comments below) for pointing this out.
<p>
<div class="note">
<u>Note:</u><br/>
The last perl one-liner example shown above will parse files in current dir and all subdirs <u>three</u> levels deep. I am not sure what would be the easiest way to parse files at an undefined depth level using perl one-liner without making it insanely cryptic. Any ideas?
</div>]]></content:encoded>
			<wfw:commentRss>http://indrayam.com/archives/how-do-i/000361.php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HOWTO: Installing and running MySQL 4.0.20, 4.1.2-alpha and 5.0.0-alpha on same RH Linux box</title>
		<link>http://indrayam.com/archives/how-do-i/000231.php</link>
		<comments>http://indrayam.com/archives/how-do-i/000231.php#comments</comments>
		<pubDate>Tue, 01 Jun 2004 20:25:18 +0000</pubDate>
		<dc:creator>anand</dc:creator>
		
		<category><![CDATA[How do I?]]></category>

		<guid isPermaLink="false">http://indrayam.com/?p=231</guid>
		<description><![CDATA[<center><img src="http://indrayam.com/images/mysql-install.jpg"></center>
<p>
Here's what I intend to do: 
<p>
<blockquote>
1. Install the various MySQL instances from <i>source</i> so that they can happily co-exist in their logically and mutually exclusive world</b><br/>
2. Facilitate easy stopping and starting of the services<br/>
3. Set up the various instances in a way that makes installing newer versions alongside the others is a trivial task<br/>
</blockquote>
<p>
The directory structure that I prefer is as follows:
<p>
<pre>
Installation file/folder(s): 
------------------------------
/usr/local/mysql/4.0.20
/usr/local/mysql/4.1.2-alpha
/usr/local/mysql/5.0.0-alpha

Configuration file/folder(s):
---------------------------------
/etc/mysql/4.0.20/my.cnf
/etc/mysql/4.1.2-alpha/my.cnf
/etc/mysql/5.0.0-alpha/my.cnf

Data and Log file/folder(s):
--------------------------------
/dbroot/mysql/4.0.20/data, /dbroot/mysql/4.0.20/logs, /dbroot/mysql/4.0.20/var
/dbroot/mysql/4.1.2-alpha/data, /dbroot/mysql/4.1.2-alpha/logs, /dbroot/mysql/4.1.2-alpha/var
/dbroot/mysql/5.0.0-alpha/data, /dbroot/mysql/5.0.0-alpha/logs, /dbroot/mysql/5.0.0-alpha/var

Service startup/shutdown executable(s):
----------------------------------------------
/etc/rc.d/init.d/mysql4
/etc/rc.d/init.d/mysql41
/etc/rc.d/init.d/mysql5
</pre>
<p>
Before we start with the usual steps of compiling and installing MySQL, let's first do a few pre-installation steps:
<p>
<pre>
1. Create a <i>/downloads</i> folder and download the 3 binaries: 
   mysql-4.0.20.tar.gz
   mysql-4.1.2-alpha.tar.gz
   mysql-5.0.0-alpha.tar.gz

2. Untar/Unzip it using the following commands:
   (prompt)&gt;tar -xvzf mysql-x.x.x.tar.gz
   This step should create 3 seperate folders in <i>/downloads</i> for the 3 different binaries

3. Download and save customized 'configure' scripts in the path shown below:
   /downloads/mysql-4.0.20/<a href="http://indrayam.com/demo/mysql/4.0.20/mysql-configure">mysql-configure</a>
   /downloads/mysql-4.1.2-alpha/<a href="http://indrayam.com/demo/mysql/4.1.2-alpha/mysql-configure">mysql-configure</a>
   /downloads/mysql-5.0.0-alpha/<a href="http://indrayam.com/demo/mysql/5.0.0-alpha/mysql-configure">mysql-configure</a>

3. Create a unix account called <i>mysql</i>:
   (root-prompt)&gt;useradd -s /sbin/nologin -r -d /dev/null mysql

   Note:
   ------
   I tend to use the same unix id for all 3 MySQL instances.

4. Setup the following folders:
   (root-prompt)&gt;mkdir -p /etc/mysql/4.0.20  
   (root-prompt)&gt;mkdir -p /etc/mysql/4.1.2-alpha
   (root-prompt)&gt;mkdir -p /etc/mysql/5.0.0-alpha

5. Download and save the service startup/shutdown files in the path shown below:
   /etc/rc.d/init.d/<a href="http://indrayam.com/demo/mysql/4.0.20/mysql4">mysql4</a>
   /etc/rc.d/init.d/<a href="http://indrayam.com/demo/mysql/4.1.2-alpha/mysql41">mysql41</a>
   /etc/rc.d/init.d/<a href="http://indrayam.com/demo/mysql/5.0.0-alpha/mysql5">mysql5</a>

6. Set up the services:
   (root-prompt)&gt;chkconfig --level 345 mysql4 on
   (root-prompt)&gt;chkconfig --level 345 mysql41 on
   (root-prompt)&gt;chkconfig --level 345 mysql5 on

7. Download and save mysql configuration files in the path shown below:
   /etc/mysql/4.0.20/<a href="http://indrayam.com/demo/mysql/4.0.20/my.cnf">my.cnf</a>
   /etc/mysql/4.1.2-alpha/<a href="http://indrayam.com/demo/mysql/4.1.2-alpha/my.cnf">my.cnf</a>
   /etc/mysql/5.0.0-alpha/<a href="http://indrayam.com/demo/mysql/5.0.0-alpha/my.cnf">my.cnf</a>
</pre>
<p>
Here's a quick look at the steps (using mysql-4.0.20.tar.gz as an example). You will repeat the same steps for 4.1.2-alpha and 5.0.0-alpha. Just
replace <i>4.0.20</i> with <i>4.1.2-alpha</i> or <i>5.0.0-alpha</i> in the steps outlined below:
<p>
<pre>
1. (prompt)&gt;wget http://mysql.mirrors.pair.com/Downloads/MySQL-4.0/mysql-4.0.20.tar.gz
2. (prompt)&gt;cd mysql-4.0.20
3. (prompt)&gt;./mysql-configure
4. (prompt)&gt;make
5. (root-prompt)&gt;make install
6. (root-prompt)&gt;scripts/mysql_install_db
7. (root-prompt)&gt;cd /db/mysql/4.0.20/data
8. (root-prompt)&gt;chown -R mysql.mysql *
9. (root-prompt)&gt;service mysql4 start

    Note:
    ------
    Replace "mysql4" with "mysql41" or "mysql5" depending upon whether you're attempting 
    to start MySQL version 4.1.2-alpha or 5.0.0-alpha instance

10. (prompt)&gt;/usr/local/mysql/4.0.20/bin/mysqladmin -u root password "&lt;root-password&gt;"
11. If you would like to enable access to root account of your MySQL from other hosts, 
    run the following:
    (prompt)&gt;/usr/local/mysql/4.0.20/bin/mysql -u root -p
    (mysql)&gt;use mysql;
    (mysql)&gt;GRANT ALL ON *.* TO root@"%" IDENTIFIED BY "&lt;root-password&gt;";
    (mysql)&gt;exit;

    Security Note:
    ----------------
    You might want to enable root to access the MySQL instance from 
    'a' host and not 'any' host (%)
12. To confirm that things actually did work as per plan, you can run the <i>ps -aux</i> command 
    and look for mysql entries. You can also check the /dbroot/mysql/4.0.20/logs/error.log file 
    for startup messages.
</pre>
<p>
After repeating the steps for MySQL 4.1.2-alpha and MySQL-5.0.0-alpha, if you're lucky and patient, you should have all three MySQL versions (and the goodies that come with it) ready to serve you <img src="http://indrayam.com/images/wink.gif" align="middle">
<p>
<div class="note">
Note:<br/>
The entries with (root-prompt)&gt; next to it signifies that those commands must be run with root privileges. Of course, you could run all these commands logged in as root.
</div>]]></description>
			<content:encoded><![CDATA[<center><img src="http://indrayam.com/images/mysql-install.jpg"></center>
<p>
Here's what I intend to do: 
<p>
<blockquote>
1. Install the various MySQL instances from <i>source</i> so that they can happily co-exist in their logically and mutually exclusive world</b><br/>
2. Facilitate easy stopping and starting of the services<br/>
3. Set up the various instances in a way that makes installing newer versions alongside the others is a trivial task<br/>
</blockquote>
<p>
The directory structure that I prefer is as follows:
<p>
<pre>
Installation file/folder(s): 
------------------------------
/usr/local/mysql/4.0.20
/usr/local/mysql/4.1.2-alpha
/usr/local/mysql/5.0.0-alpha

Configuration file/folder(s):
---------------------------------
/etc/mysql/4.0.20/my.cnf
/etc/mysql/4.1.2-alpha/my.cnf
/etc/mysql/5.0.0-alpha/my.cnf

Data and Log file/folder(s):
--------------------------------
/dbroot/mysql/4.0.20/data, /dbroot/mysql/4.0.20/logs, /dbroot/mysql/4.0.20/var
/dbroot/mysql/4.1.2-alpha/data, /dbroot/mysql/4.1.2-alpha/logs, /dbroot/mysql/4.1.2-alpha/var
/dbroot/mysql/5.0.0-alpha/data, /dbroot/mysql/5.0.0-alpha/logs, /dbroot/mysql/5.0.0-alpha/var

Service startup/shutdown executable(s):
----------------------------------------------
/etc/rc.d/init.d/mysql4
/etc/rc.d/init.d/mysql41
/etc/rc.d/init.d/mysql5
</pre>
<p>
Before we start with the usual steps of compiling and installing MySQL, let's first do a few pre-installation steps:
<p>
<pre>
1. Create a <i>/downloads</i> folder and download the 3 binaries: 
   mysql-4.0.20.tar.gz
   mysql-4.1.2-alpha.tar.gz
   mysql-5.0.0-alpha.tar.gz

2. Untar/Unzip it using the following commands:
   (prompt)&gt;tar -xvzf mysql-x.x.x.tar.gz
   This step should create 3 seperate folders in <i>/downloads</i> for the 3 different binaries

3. Download and save customized 'configure' scripts in the path shown below:
   /downloads/mysql-4.0.20/<a href="http://indrayam.com/demo/mysql/4.0.20/mysql-configure">mysql-configure</a>
   /downloads/mysql-4.1.2-alpha/<a href="http://indrayam.com/demo/mysql/4.1.2-alpha/mysql-configure">mysql-configure</a>
   /downloads/mysql-5.0.0-alpha/<a href="http://indrayam.com/demo/mysql/5.0.0-alpha/mysql-configure">mysql-configure</a>

3. Create a unix account called <i>mysql</i>:
   (root-prompt)&gt;useradd -s /sbin/nologin -r -d /dev/null mysql

   Note:
   ------
   I tend to use the same unix id for all 3 MySQL instances.

4. Setup the following folders:
   (root-prompt)&gt;mkdir -p /etc/mysql/4.0.20  
   (root-prompt)&gt;mkdir -p /etc/mysql/4.1.2-alpha
   (root-prompt)&gt;mkdir -p /etc/mysql/5.0.0-alpha

5. Download and save the service startup/shutdown files in the path shown below:
   /etc/rc.d/init.d/<a href="http://indrayam.com/demo/mysql/4.0.20/mysql4">mysql4</a>
   /etc/rc.d/init.d/<a href="http://indrayam.com/demo/mysql/4.1.2-alpha/mysql41">mysql41</a>
   /etc/rc.d/init.d/<a href="http://indrayam.com/demo/mysql/5.0.0-alpha/mysql5">mysql5</a>

6. Set up the services:
   (root-prompt)&gt;chkconfig --level 345 mysql4 on
   (root-prompt)&gt;chkconfig --level 345 mysql41 on
   (root-prompt)&gt;chkconfig --level 345 mysql5 on

7. Download and save mysql configuration files in the path shown below:
   /etc/mysql/4.0.20/<a href="http://indrayam.com/demo/mysql/4.0.20/my.cnf">my.cnf</a>
   /etc/mysql/4.1.2-alpha/<a href="http://indrayam.com/demo/mysql/4.1.2-alpha/my.cnf">my.cnf</a>
   /etc/mysql/5.0.0-alpha/<a href="http://indrayam.com/demo/mysql/5.0.0-alpha/my.cnf">my.cnf</a>
</pre>
<p>
Here's a quick look at the steps (using mysql-4.0.20.tar.gz as an example). You will repeat the same steps for 4.1.2-alpha and 5.0.0-alpha. Just
replace <i>4.0.20</i> with <i>4.1.2-alpha</i> or <i>5.0.0-alpha</i> in the steps outlined below:
<p>
<pre>
1. (prompt)&gt;wget http://mysql.mirrors.pair.com/Downloads/MySQL-4.0/mysql-4.0.20.tar.gz
2. (prompt)&gt;cd mysql-4.0.20
3. (prompt)&gt;./mysql-configure
4. (prompt)&gt;make
5. (root-prompt)&gt;make install
6. (root-prompt)&gt;scripts/mysql_install_db
7. (root-prompt)&gt;cd /db/mysql/4.0.20/data
8. (root-prompt)&gt;chown -R mysql.mysql *
9. (root-prompt)&gt;service mysql4 start

    Note:
    ------
    Replace "mysql4" with "mysql41" or "mysql5" depending upon whether you're attempting 
    to start MySQL version 4.1.2-alpha or 5.0.0-alpha instance

10. (prompt)&gt;/usr/local/mysql/4.0.20/bin/mysqladmin -u root password "&lt;root-password&gt;"
11. If you would like to enable access to root account of your MySQL from other hosts, 
    run the following:
    (prompt)&gt;/usr/local/mysql/4.0.20/bin/mysql -u root -p
    (mysql)&gt;use mysql;
    (mysql)&gt;GRANT ALL ON *.* TO root@"%" IDENTIFIED BY "&lt;root-password&gt;";
    (mysql)&gt;exit;

    Security Note:
    ----------------
    You might want to enable root to access the MySQL instance from 
    'a' host and not 'any' host (%)
12. To confirm that things actually did work as per plan, you can run the <i>ps -aux</i> command 
    and look for mysql entries. You can also check the /dbroot/mysql/4.0.20/logs/error.log file 
    for startup messages.
</pre>
<p>
After repeating the steps for MySQL 4.1.2-alpha and MySQL-5.0.0-alpha, if you're lucky and patient, you should have all three MySQL versions (and the goodies that come with it) ready to serve you <img src="http://indrayam.com/images/wink.gif" align="middle">
<p>
<div class="note">
Note:<br/>
The entries with (root-prompt)&gt; next to it signifies that those commands must be run with root privileges. Of course, you could run all these commands logged in as root.
</div>]]></content:encoded>
			<wfw:commentRss>http://indrayam.com/archives/how-do-i/000231.php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HOWTO: Searching for a text pattern in all files under a folder</title>
		<link>http://indrayam.com/archives/how-do-i/000030.php</link>
		<comments>http://indrayam.com/archives/how-do-i/000030.php#comments</comments>
		<pubDate>Sun, 02 May 2004 06:26:31 +0000</pubDate>
		<dc:creator>anand</dc:creator>
		
		<category><![CDATA[How do I?]]></category>

		<guid isPermaLink="false">http://indrayam.com/?p=30</guid>
		<description><![CDATA[As someone who prefers spending more time firing commands on a bash shell prompt than interacting with pretty GUIs via a mouse, I too rely on 'aliases' to make myself productive. The following <i>alias</i> is one of my favorites that I religiously setup everytime I get a Unix account:
<blockquote>alias wgrep='find . -type f -print|xargs grep -i $1'</blockquote>
So, if I want to search for a certain pattern in all files under the current folder, I just type:
<blockquote>(bash-prompt)&gt;wgrep test</blockquote>
Notice that the alias only supports searching for a pattern in the current folder. How would you change the alias to support something like:
<blockquote>(bash-prompt)&gt;wgrep &lt;folder-name&gt; &lt;pattern-name&gt;</blockquote>]]></description>
			<content:encoded><![CDATA[As someone who prefers spending more time firing commands on a bash shell prompt than interacting with pretty GUIs via a mouse, I too rely on 'aliases' to make myself productive. The following <i>alias</i> is one of my favorites that I religiously setup everytime I get a Unix account:
<blockquote>alias wgrep='find . -type f -print|xargs grep -i $1'</blockquote>
So, if I want to search for a certain pattern in all files under the current folder, I just type:
<blockquote>(bash-prompt)&gt;wgrep test</blockquote>
Notice that the alias only supports searching for a pattern in the current folder. How would you change the alias to support something like:
<blockquote>(bash-prompt)&gt;wgrep &lt;folder-name&gt; &lt;pattern-name&gt;</blockquote>]]></content:encoded>
			<wfw:commentRss>http://indrayam.com/archives/how-do-i/000030.php/feed/</wfw:commentRss>
		</item>
		<item>
		<title>HOWTO: Removing ALL folders named &#8216;CVS&#8217; in Unix and Windows</title>
		<link>http://indrayam.com/archives/how-do-i/000021.php</link>
		<comments>http://indrayam.com/archives/how-do-i/000021.php#comments</comments>
		<pubDate>Thu, 29 Apr 2004 17:04:18 +0000</pubDate>
		<dc:creator>anand</dc:creator>
		
		<category><![CDATA[How do I?]]></category>

		<guid isPermaLink="false">http://indrayam.com/?p=21</guid>
		<description><![CDATA[You have a working directory of a CVS module. You want to de-CVSify it so that you can a) use folders in another CVS project you're about to import or b)package it up for someone without all the CVS clutter. How would you do it natively in WinXP and Unix . No Cygwin hacks in Windows or some Windows util on Unix allowed (if something like that even exists..<img src="http://indrayam.com/images/wink.gif" align="middle">). <p>In Unix, thanks to 'find' and 'xargs' this thing is fairly simple in Unix:<p>Assuming name of the folder is 'cvsapp', the command would look something like:<blockquote>(unix prompt)&gt;find /foldername | xargs rm -r</blockquote><p>In Windows, it's not too bad either:
<center><img src="http://indrayam.com/images/howto-windows-find.gif" border="0"></center>
Go to the folder in Windows explorer, click on 'Search'. A window such as the one shown above would open up. Enter CVS and hit 'Search'. Then select all and 'delete' it.<p>Needless to say, each of the approaches can be tweaked for your specific needs (which might have nothing to do with CVS folders). Here's an exercise for you (and me) and maybe I will talk about it my next HOWTO assignment:<blockquote>What if you wanted to search for all files or folders starting (or ending) with 'evil' and wanted to trash those?</blockquote>]]></description>
			<content:encoded><![CDATA[You have a working directory of a CVS module. You want to de-CVSify it so that you can a) use folders in another CVS project you're about to import or b)package it up for someone without all the CVS clutter. How would you do it natively in WinXP and Unix . No Cygwin hacks in Windows or some Windows util on Unix allowed (if something like that even exists..<img src="http://indrayam.com/images/wink.gif" align="middle">). <p>In Unix, thanks to 'find' and 'xargs' this thing is fairly simple in Unix:<p>Assuming name of the folder is 'cvsapp', the command would look something like:<blockquote>(unix prompt)&gt;find /foldername | xargs rm -r</blockquote><p>In Windows, it's not too bad either:
<center><img src="http://indrayam.com/images/howto-windows-find.gif" border="0"></center>
Go to the folder in Windows explorer, click on 'Search'. A window such as the one shown above would open up. Enter CVS and hit 'Search'. Then select all and 'delete' it.<p>Needless to say, each of the approaches can be tweaked for your specific needs (which might have nothing to do with CVS folders). Here's an exercise for you (and me) and maybe I will talk about it my next HOWTO assignment:<blockquote>What if you wanted to search for all files or folders starting (or ending) with 'evil' and wanted to trash those?</blockquote>]]></content:encoded>
			<wfw:commentRss>http://indrayam.com/archives/how-do-i/000021.php/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
