<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Bash history substitution</title>
	<link>http://www.spugbrap.com/blog/2006/07/bash-history-substitution/</link>
	<description>This is a repository for my favorite scripts, regexes, commandlines, utilities, code snippets, tips, and other geeky things that might be useful to someone googling for an obscure solution some day. It's also a place to share my thoughts about companies I've dealt with, my favorite lifehacks, observations of interesting human behavior, clever and/or evil marketing schemes I've run across, and anything else I feel compelled to write about.</description>
	<pubDate>Tue, 06 Jan 2009 09:31:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>

	<item>
		<title>By: spugbrap</title>
		<link>http://www.spugbrap.com/blog/2006/07/bash-history-substitution/#comment-80</link>
		<dc:creator>spugbrap</dc:creator>
		<pubDate>Wed, 19 Jul 2006 14:26:41 +0000</pubDate>
		<guid>http://www.spugbrap.com/blog/2006/07/bash-history-substitution/#comment-80</guid>
		<description>I often do the type of previous command editing that you described, clint.. but in this particular case, there are actually about 10 date-based  filenames on the commandline, and changing them all manually got tedious.&lt;br/&gt;&lt;br/&gt;The 's' is for substitution. :)&lt;br/&gt;"s/old/new/&lt;br/&gt;    Substitute new for the first occurrence of old in the event line. [...]" (from the &lt;a HREF="http://web.mit.edu/gnu/doc/html/features_6.html" REL="nofollow"&gt;bash reference page&lt;/a&gt; mentioned at the bottom of the &lt;a HREF="http://spugbrap.blogspot.com/2006/07/bash-history-substitution.html" REL="nofollow"&gt;original post&lt;/a&gt;).&lt;br/&gt;&lt;br/&gt;But yeah, the 'g' was crucial for doing what I needed to do.. otherwise, the method I already knew about (^old^new^) would have sufficed.</description>
		<content:encoded><![CDATA[<p>I often do the type of previous command editing that you described, clint.. but in this particular case, there are actually about 10 date-based  filenames on the commandline, and changing them all manually got tedious.</p>
<p>The &#8217;s&#8217; is for substitution. :)<br />&#8220;s/old/new/<br />    Substitute new for the first occurrence of old in the event line. [&#8230;]&#8221; (from the <a HREF="http://web.mit.edu/gnu/doc/html/features_6.html" REL="nofollow">bash reference page</a> mentioned at the bottom of the <a HREF="http://spugbrap.blogspot.com/2006/07/bash-history-substitution.html" REL="nofollow">original post</a>).</p>
<p>But yeah, the &#8216;g&#8217; was crucial for doing what I needed to do.. otherwise, the method I already knew about (^old^new^) would have sufficed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ClintJCL</title>
		<link>http://www.spugbrap.com/blog/2006/07/bash-history-substitution/#comment-79</link>
		<dc:creator>ClintJCL</dc:creator>
		<pubDate>Wed, 19 Jul 2006 14:20:16 +0000</pubDate>
		<guid>http://www.spugbrap.com/blog/2006/07/bash-history-substitution/#comment-79</guid>
		<description>gah!&lt;br/&gt;&lt;br/&gt;I'm happy with up-arrow,enter.&lt;br/&gt;&lt;br/&gt;It seems that the thought required to do those is almost more work.  I would just do "cat[uparrow][ctrl-left a cpl times][changes 4 to 5]"...   &lt;br/&gt;&lt;br/&gt;That's a neat trick though.&lt;br/&gt;&lt;br/&gt;g for global change (like perl), but what is the s for?</description>
		<content:encoded><![CDATA[<p>gah!</p>
<p>I&#8217;m happy with up-arrow,enter.</p>
<p>It seems that the thought required to do those is almost more work.  I would just do &#8220;cat[uparrow][ctrl-left a cpl times][changes 4 to 5]&#8221;&#8230;   </p>
<p>That&#8217;s a neat trick though.</p>
<p>g for global change (like perl), but what is the s for?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
