<?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: Music management</title>
	<atom:link href="http://blog.stuart.shelton.me/archives/29/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.stuart.shelton.me/archives/29</link>
	<description>Normal service will be resumed shortly...</description>
	<lastBuildDate>Mon, 23 Jan 2012 20:24:47 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Stuart</title>
		<link>http://blog.stuart.shelton.me/archives/29/comment-page-1#comment-12</link>
		<dc:creator>Stuart</dc:creator>
		<pubDate>Tue, 31 Oct 2006 09:17:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.srcshelton.miltonroad.net/?p=29#comment-12</guid>
		<description>Answering my own question, how about this:

&lt;pre&gt;LASTDIR=&quot;&quot;
find &lt;path&gt; -iname \*.ogg -type f &#124; while read FILE; do
    DIR=&quot;$( dirname &quot;$FILE&quot; )&quot;
    NAME=&quot;$( basename &quot;$FILE&quot; )&quot;
    NAME=&quot;${NAME/.ogg/}&quot;
    TITLE=&quot;$( ogginfo &quot;$FILE&quot; &#124; grep -i &quot;title=&quot; &#124; cut -d&quot;=&quot; -f 2 )&quot;
    TITLE=&quot;${TITLE/\//\\}&quot;
    if [ -n &quot;$TITLE&quot; -a &quot;$NAME&quot; != &quot;$TITLE&quot; ]; then
        if [ &quot;$LASTDIR&quot; != &quot;$DIR&quot; ]; then
            echo &quot;cd \&quot;$DIR\&quot; &#124;&#124; exit 1&quot;
            LASTDIR=&quot;$DIR&quot;
        fi
        echo &quot;mv &#039;$NAME.ogg&#039; &#039;$TITLE.ogg&#039;&quot;
    fi
done &#124; tee rename.sh &amp;&amp; chmod 755 rename.sh &amp;&amp; ./rename.sh&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Answering my own question, how about this:</p>
<pre>LASTDIR=""
find &lt;path&gt; -iname \*.ogg -type f | while read FILE; do
    DIR="$( dirname "$FILE" )"
    NAME="$( basename "$FILE" )"
    NAME="${NAME/.ogg/}"
    TITLE="$( ogginfo "$FILE" | grep -i "title=" | cut -d"=" -f 2 )"
    TITLE="${TITLE/\//\\}"
    if [ -n "$TITLE" -a "$NAME" != "$TITLE" ]; then
        if [ "$LASTDIR" != "$DIR" ]; then
            echo "cd \"$DIR\" || exit 1"
            LASTDIR="$DIR"
        fi
        echo "mv '$NAME.ogg' '$TITLE.ogg'"
    fi
done | tee rename.sh &#038;&#038; chmod 755 rename.sh &#038;&#038; ./rename.sh</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

