[TxMt] Re: Spaces in the path/to/TextMate.app

Matt Neuburg matt at tidbits.com
Sun Jul 26 19:05:55 UTC 2009


On 7/26/09 3:03 AM, in article
A2161761-80B3-4D46-8D67-D3968371A7FB at textmate.org, "Allan Odgaard"
<mailinglist at textmate.org> wrote:

> Yeah, it is a very common problem. What you need to do is add this line:
> 
>      require ENV['TM_SUPPORT_PATH'] + '/lib/escape'
> 
> Then whenever you send a string to the shell, use the e_sh function to
> properly escape it. E.g.:
> 
>      path = "some path with spaces"
>      dst  = ENV['TMPDIR'] || "/tmp"
> 
>      IO.popen("cp #{e_sh path} #{e_sh dst}", Š)

Thanks - I did that as my first solution, but then I realized that since the
whole thing was going to the shell I could escape it by quoting it, just as
I would do in the shell:

   IO.popen(%{"#{ENV['TM_SUPPORT_PATH']}/bin/Markdown.pl"}, ...)

or whatever. That seems to be working... m.

-- 
matt neuburg, phd = matt at tidbits.com, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings






More information about the textmate mailing list