<?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>VirtualChaos - Nadeem's blog &#187; bash-one-liner</title>
	<atom:link href="http://www.virtualchaos.co.uk/blog/tag/bash-one-liner/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.virtualchaos.co.uk/blog</link>
	<description>I thought what I'd do was, I'd pretend I was one of those deaf mutes ... or should I?</description>
	<lastBuildDate>Fri, 20 Jan 2012 09:27:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>SVN: Useful bash commands</title>
		<link>http://www.virtualchaos.co.uk/blog/2008/10/18/svn-useful-bash-commands/</link>
		<comments>http://www.virtualchaos.co.uk/blog/2008/10/18/svn-useful-bash-commands/#comments</comments>
		<pubDate>Sat, 18 Oct 2008 10:14:33 +0000</pubDate>
		<dc:creator>nadeem.shabir</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash-one-liner]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.virtualchaos.co.uk/blog/?p=482</guid>
		<description><![CDATA[Here&#8217;s a couple of useful bash commands I&#8217;ve been using recently when working with Subversion: The first helps me with an annoyance I have with externals. Normally doing a &#8220;svn st &#8211;ignore-externals&#8221; still lists all the externals even though I&#8217;m not actually interesting in seeing them when I want to know what I&#8217;ve changed locally. [...]]]></description>
			<content:encoded><![CDATA[<p>
Here&#8217;s a couple of useful bash commands I&#8217;ve been using recently when working with Subversion:
</p>
<p>The first helps me with an annoyance I have with externals. Normally doing a &#8220;svn st &#8211;ignore-externals&#8221; still lists all the externals even though I&#8217;m not actually interesting in seeing them when I want to know what I&#8217;ve changed locally. For example in the output below I only really want to know that I&#8217;ve changed &#8216;development-tenants.xml&#8217;, i&#8217;m not really interested in the rest.
</p>
<blockquote>
<pre>Nadeems-Computer:zephyr-trunk nadeemshabir$ svn st --ignore externals
X      lib/arc
X      lib/moriarty
X      lib/simpleSAMLphp
X      3rdPartyDevelopmentTools/svnant-1.0.0
X      3rdPartyDevelopmentTools/PHPUnit
X      3rdPartyDevelopmentTools/selenium-server-1.0-beta-1
X      3rdPartyDevelopmentTools/selenium-core-0.8.3
M      developmentdata/development-tenants.xml</pre>
</blockquote>
<p>
To address this the first command is an alias I&#8217;ve created that shows me all the files that I&#8217;ve changed/added/removed locally but specifically doesn&#8217;t list anything related to any externals</p>
<blockquote>
<pre>alias whatschanged='svn st --ignore-externals | grep -v "^X "'</pre>
</blockquote>
<p>
The second bash command deals with the fact that I often have a large number of files I want to add to subversion all at once. This command takes all un-added files and adds them to subversion &#8230;
</p>
<blockquote>
<pre>
svn st | grep '^? ' | awk '{ print $2 }' | xargs svn add
</pre>
</blockquote>
<p>Hope you find them useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.virtualchaos.co.uk/blog/2008/10/18/svn-useful-bash-commands/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cool Bash One-Liner: SVN add all unadded files</title>
		<link>http://www.virtualchaos.co.uk/blog/2008/02/03/cool-bash-one-liner-svn-add-all-unadded-files/</link>
		<comments>http://www.virtualchaos.co.uk/blog/2008/02/03/cool-bash-one-liner-svn-add-all-unadded-files/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 10:37:32 +0000</pubDate>
		<dc:creator>nadeem.shabir</dc:creator>
				<category><![CDATA[Cool stuff]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Talis]]></category>
		<category><![CDATA[bash-one-liner]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://www.virtualchaos.co.uk/blog/2008/02/03/cool-bash-one-liner-svn-add-all-unadded-files/</guid>
		<description><![CDATA[&#160; svn st &#124; grep &#34;^? &#34; &#124; awk &#8216;{ print $2 }&#8217; &#124; xargs svn add &#160;]]></description>
			<content:encoded><![CDATA[<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">svn st | <span class="kw2">grep</span> <span class="st0">&quot;^? &quot;</span> | <span class="kw2">awk</span> <span class="st0">&#8216;{ print $2 }&#8217;</span> | <span class="kw2">xargs</span> svn add</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.virtualchaos.co.uk/blog/2008/02/03/cool-bash-one-liner-svn-add-all-unadded-files/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cool Bash One-Liner: Post files to Platform Store</title>
		<link>http://www.virtualchaos.co.uk/blog/2008/02/03/cool-bash-one-liner-post-files-to-platform-store/</link>
		<comments>http://www.virtualchaos.co.uk/blog/2008/02/03/cool-bash-one-liner-post-files-to-platform-store/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 10:33:34 +0000</pubDate>
		<dc:creator>nadeem.shabir</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash-one-liner]]></category>
		<category><![CDATA[Talis]]></category>

		<guid isPermaLink="false">http://www.virtualchaos.co.uk/blog/2008/02/03/cool-bash-one-liner-post-files-to-platform-store/</guid>
		<description><![CDATA[As part of some small prototyping activity I had to convert a whole load of data into rdf. My problem was that the files I had generated were scattered around in a very hierarchical directory structure, but all I wanted to do was find them and most them to a platform store. I really didn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>As part of some small prototyping activity I had to convert a whole load of data into rdf. My problem was that the files I had generated were scattered around in a very hierarchical directory structure, but all I wanted to do was find them and most them to a platform store. I really didn&#8217;t want to have to post them one at time manually. I knew I could do it using a bash script but my scripting was a bit rusty &#8230; so I asked <a href="http://www.dynamicorange.com/blog/">Rob</a>, he showed me how to do this &#8230; </p>
<div class="dean_ch" style="white-space: wrap;">
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">find</span> . -name <span class="st0">&quot;*-issue.xml.rdf&quot;</span> | <span class="kw2">sed</span> -e <span class="st0">&#8216;s!^<span class="es0">\.</span>/<span class="es0">\(</span>[0-9]*-issue.xml.rdf<span class="es0">\)</span>!curl -v -d @<span class="es0">\1</span> &nbsp;-H content-type:application/rdf+xml http://api.talis.com/stores/kiyanwang-dev1/meta!&#8217;</span> | bash</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
</ol>
</div>
<p>Cool, huh? <img src='http://www.virtualchaos.co.uk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>For the un-initiated, the <b>find</b> locates all the files I want to post which in my case ended with <em>-issue.xml.rdf</em>. The <b>sed</b> search and replace matches the filename, and then replaces it with a curl command, inserting the filename as a parameter <b>@\1</b>. Finally the generated curl command is piped to bash which executes each generated line.<br />
.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.virtualchaos.co.uk/blog/2008/02/03/cool-bash-one-liner-post-files-to-platform-store/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

