<?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"
	>
<channel>
	<title>Comments on: Using AWK to remove file extensions</title>
	<atom:link href="http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/feed/" rel="self" type="application/rss+xml" />
	<link>http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/</link>
	<description>English scratches and Italian notes written by Carlo Perassi</description>
	<pubDate>Fri, 25 Jul 2008 08:09:55 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Carlo</title>
		<link>http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-962</link>
		<dc:creator>Carlo</dc:creator>
		<pubDate>Wed, 01 Aug 2007 12:20:45 +0000</pubDate>
		<guid isPermaLink="false">http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-962</guid>
		<description>@anonymous:
this is the reason I wrote
&lt;blockquote&gt;it’s definitely easy to achieve it if your files have just a “.” in their names&lt;/blockquote&gt;
Anyway, your problem could be solved with
&lt;code&gt;for i in $(ls *.txt.old &#124; awk -F "." '{print $1}'); do mv $i.txt.old $i.txt; done&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>@anonymous:<br />
this is the reason I wrote</p>
<blockquote><p>it’s definitely easy to achieve it if your files have just a “.” in their names</p></blockquote>
<p>Anyway, your problem could be solved with<br />
<code>for i in $(ls *.txt.old | awk -F "." '{print $1}'); do mv $i.txt.old $i.txt; done</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anonymous</title>
		<link>http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-961</link>
		<dc:creator>anonymous</dc:creator>
		<pubDate>Wed, 01 Aug 2007 11:41:20 +0000</pubDate>
		<guid isPermaLink="false">http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-961</guid>
		<description>&lt;p&gt;Ahh, but what if you have files like "file.txt.old"&lt;/p&gt;
&lt;p&gt;Then you are somewhat stuffed, as the extention gets defined to be .txt.old, rather than .old?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Ahh, but what if you have files like &#8220;file.txt.old&#8221;</p>
<p>Then you are somewhat stuffed, as the extention gets defined to be .txt.old, rather than .old?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlo</title>
		<link>http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-701</link>
		<dc:creator>Carlo</dc:creator>
		<pubDate>Wed, 11 Apr 2007 12:42:49 +0000</pubDate>
		<guid isPermaLink="false">http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-701</guid>
		<description>Booger:
Good :)
A solution to your problem could be:
&lt;code&gt;l *.sd *.sb -1 &#124; awk -F "." '{print $1}' &#124; uniq -c &#124; awk '$1=="1" {print $2}'&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Booger:<br />
Good <img src='http://perassi.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
A solution to your problem could be:<br />
<code>l *.sd *.sb -1 | awk -F "." '{print $1}' | uniq -c | awk '$1=="1" {print $2}'</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Booger</title>
		<link>http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-700</link>
		<dc:creator>Booger</dc:creator>
		<pubDate>Tue, 10 Apr 2007 18:21:10 +0000</pubDate>
		<guid isPermaLink="false">http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-700</guid>
		<description>this is great - i don't think "tannoiser" understands how an example should illustrate a concept with an easy example so that you can modify it to real needs.  In particular, I use a compiler that compiles xyz.sd into xyz.sb.  So on a directory of 1000 .sd's the easiest way to find the 3 that don't compile is to list all of the .sds and .sbs, remove the extensions and do uniq on the list to see which have only 1 entry (not 2).  And AWK is a GREAT tool to do this</description>
		<content:encoded><![CDATA[<p>this is great - i don&#8217;t think &#8220;tannoiser&#8221; understands how an example should illustrate a concept with an easy example so that you can modify it to real needs.  In particular, I use a compiler that compiles xyz.sd into xyz.sb.  So on a directory of 1000 .sd&#8217;s the easiest way to find the 3 that don&#8217;t compile is to list all of the .sds and .sbs, remove the extensions and do uniq on the list to see which have only 1 entry (not 2).  And AWK is a GREAT tool to do this</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlo</title>
		<link>http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-642</link>
		<dc:creator>Carlo</dc:creator>
		<pubDate>Wed, 14 Mar 2007 19:39:07 +0000</pubDate>
		<guid isPermaLink="false">http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-642</guid>
		<description>Random Guy:
try with
find folder_name -name *jpg</description>
		<content:encoded><![CDATA[<p>Random Guy:<br />
try with<br />
find folder_name -name *jpg</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Random Guy</title>
		<link>http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-641</link>
		<dc:creator>Random Guy</dc:creator>
		<pubDate>Wed, 14 Mar 2007 11:30:54 +0000</pubDate>
		<guid isPermaLink="false">http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-641</guid>
		<description>any idea how to make your example work on all subfolders within a directory also?  i tried ls -R but it won't work.</description>
		<content:encoded><![CDATA[<p>any idea how to make your example work on all subfolders within a directory also?  i tried ls -R but it won&#8217;t work.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tannoiser</title>
		<link>http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-431</link>
		<dc:creator>tannoiser</dc:creator>
		<pubDate>Sun, 18 Feb 2007 18:02:30 +0000</pubDate>
		<guid isPermaLink="false">http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-431</guid>
		<description>I know, Carlo, and your code is nice.
But to me, the correct answer  is "don't". Use the appropriate tool, it's often a good suggestion. ;)

(of course, this is for the original "researcher"... :))</description>
		<content:encoded><![CDATA[<p>I know, Carlo, and your code is nice.<br />
But to me, the correct answer  is &#8220;don&#8217;t&#8221;. Use the appropriate tool, it&#8217;s often a good suggestion. <img src='http://perassi.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>(of course, this is for the original &#8220;researcher&#8221;&#8230; :))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Carlo</title>
		<link>http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-421</link>
		<dc:creator>Carlo</dc:creator>
		<pubDate>Sat, 17 Feb 2007 16:05:19 +0000</pubDate>
		<guid isPermaLink="false">http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-421</guid>
		<description>&lt;p&gt;Good answer but the original problem was about using AWK :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Good answer but the original problem was about using AWK <img src='http://perassi.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tannoiser</title>
		<link>http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-420</link>
		<dc:creator>tannoiser</dc:creator>
		<pubDate>Sat, 17 Feb 2007 13:47:26 +0000</pubDate>
		<guid isPermaLink="false">http://perassi.org/2007/02/16/using-awk-to-remove-file-extensions/#comment-420</guid>
		<description>*cough*

rename 's/\.jpg$//' *.jpg

;)</description>
		<content:encoded><![CDATA[<p>*cough*</p>
<p>rename &#8217;s/\.jpg$//&#8217; *.jpg</p>
<p> <img src='http://perassi.org/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
