<?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: launching textpad from cygwin</title>
	<link>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/</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 01:45:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>

	<item>
		<title>By: spugbrap</title>
		<link>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/#comment-425</link>
		<dc:creator>spugbrap</dc:creator>
		<pubDate>Mon, 17 Sep 2007 12:50:45 +0000</pubDate>
		<guid>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/#comment-425</guid>
		<description>Ack! The function I posted in the comment, above, had a flaw: the 'p' variable never gets reset. Every time the 'tp' function is executed, the string 'p' already contains the values from every previous invocation, because the function keeps appending to p, without ever clearing it. 

The following works better, and includes debug output that I don't mind seeing every time I run the function:

&lt;code&gt;function tp()
{
  echo tp:input:$*
  unset p 
  for ((at=1; at &lt;= $#; at++))
  do
    p="$p `cygpath -wa ${!at}`"
  done
  echo tp:output:$p
  textpad $p &#038;
}&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Ack! The function I posted in the comment, above, had a flaw: the &#8216;p&#8217; variable never gets reset. Every time the &#8216;tp&#8217; function is executed, the string &#8216;p&#8217; already contains the values from every previous invocation, because the function keeps appending to p, without ever clearing it. </p>
<p>The following works better, and includes debug output that I don&#8217;t mind seeing every time I run the function:</p>
<p><code>function tp()<br />
{<br />
  echo tp:input:$*<br />
  unset p<br />
  for ((at=1; at < = $#; at++))<br />
  do<br />
    p="$p `cygpath -wa ${!at}`"<br />
  done<br />
  echo tp:output:$p<br />
  textpad $p &#038;<br />
}</code></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: spugbrap</title>
		<link>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/#comment-399</link>
		<dc:creator>spugbrap</dc:creator>
		<pubDate>Fri, 31 Aug 2007 16:12:53 +0000</pubDate>
		<guid>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/#comment-399</guid>
		<description>are you threatening me?</description>
		<content:encoded><![CDATA[<p>are you threatening me?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ClintJCL</title>
		<link>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/#comment-398</link>
		<dc:creator>ClintJCL</dc:creator>
		<pubDate>Fri, 31 Aug 2007 14:57:01 +0000</pubDate>
		<guid>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/#comment-398</guid>
		<description>for your bunghole?</description>
		<content:encoded><![CDATA[<p>for your bunghole?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: spugbrap</title>
		<link>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/#comment-397</link>
		<dc:creator>spugbrap</dc:creator>
		<pubDate>Fri, 31 Aug 2007 13:08:48 +0000</pubDate>
		<guid>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/#comment-397</guid>
		<description>&lt;p&gt;Woohoo! Thanks to &lt;a href="http://warpedvisions.org/"&gt;Bruce&lt;/a&gt;, who posted &lt;a href="http://marc.abramowitz.info/archives/2007/08/29/making-cygwin-and-windows-cooperate/#comment-272675"&gt;this for loop&lt;/a&gt; in a comment on &lt;a href="http://marc.abramowitz.info"&gt;Marc Abramowitz's blog&lt;/a&gt;, I now have a 'tp' function that supports multiple paths on the command-line:&lt;/p&gt;

&lt;code&gt;function tp()
{
  for ((at=1; at &lt;= $#; at++))
  do
    p="$p `cygpath -wa ${!at}`"
  done
  textpad $p &#038;
}
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Woohoo! Thanks to <a href="http://warpedvisions.org/">Bruce</a>, who posted <a href="http://marc.abramowitz.info/archives/2007/08/29/making-cygwin-and-windows-cooperate/#comment-272675">this for loop</a> in a comment on <a href="http://marc.abramowitz.info">Marc Abramowitz&#8217;s blog</a>, I now have a &#8216;tp&#8217; function that supports multiple paths on the command-line:</p>
<p><code>function tp()<br />
{<br />
  for ((at=1; at < = $#; at++))<br />
  do<br />
    p="$p `cygpath -wa ${!at}`"<br />
  done<br />
  textpad $p &#038;<br />
}<br />
</code></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ClintJCL</title>
		<link>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/#comment-267</link>
		<dc:creator>ClintJCL</dc:creator>
		<pubDate>Mon, 16 Apr 2007 23:46:58 +0000</pubDate>
		<guid>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/#comment-267</guid>
		<description>Hmm... I've never done a side-by-side comparison.. I just know textpad didn't stick with me, and editplus did. but some of that may have been timing -- 1999(?) vs 2005.</description>
		<content:encoded><![CDATA[<p>Hmm&#8230; I&#8217;ve never done a side-by-side comparison.. I just know textpad didn&#8217;t stick with me, and editplus did. but some of that may have been timing &#8212; 1999(?) vs 2005.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: spugbrap</title>
		<link>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/#comment-264</link>
		<dc:creator>spugbrap</dc:creator>
		<pubDate>Mon, 16 Apr 2007 13:25:15 +0000</pubDate>
		<guid>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/#comment-264</guid>
		<description>TextPad!</description>
		<content:encoded><![CDATA[<p>TextPad!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ClintJCL</title>
		<link>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/#comment-260</link>
		<dc:creator>ClintJCL</dc:creator>
		<pubDate>Sat, 14 Apr 2007 16:46:40 +0000</pubDate>
		<guid>http://www.spugbrap.com/blog/2007/04/launching-textpad-from-cygwin/#comment-260</guid>
		<description>EditPlus!</description>
		<content:encoded><![CDATA[<p>EditPlus!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
