[SVN] Passing variables to osascript, or other workaround?
Jeroen van der Ham
jeroen at je-ju.net
Thu May 12 08:24:37 UTC 2005
On 12-05-2005 08:50, Charilaos Skiadas wrote:
> On May 11, 2005, at 10:33 PM, Allan Odgaard wrote:
>> And you're certainly right about the shell being slow, here's the
>> times on my 2.5 GHz G5:
>> sed 1.020s
>> perl 1.300s
>> ruby 2.191s
>> bash 11.008s
>> Btw: if you want to experiment with this, just paste the loop into TM,
>> select it, and press ctrl-R, then it'll run it within TM and output
>> the result -- a bit easier than to play with this in a terminal window :)
> Just tried with the sed and bash methods. quite startling difference on
> my iBook G4:
> sed 2.093s
> bash 36.259s !!!!!!!
>> Bash rarely allow nested statements, what you can do is use commands
>> instead of built-in features:
>> list=$(cut <<<$list -b-80|sed -e 's|\\|\\\\|g')
> neat! I need to do some more reading it seems... I hadn't even heard of
> cut. :-)
>> Btw: I switched from `...` to $(...) because the former requires
>> escaping of \, and I switched from s/.../.../ to s|...|...| in the sed
>> substitution for cosmetic reasons.
> I see what you mean :-) I have to admit though, I'm so used to seeing
> the s/../../ syntax, that the alternative seems a bit weird. I'll grow
> out of it hopefully.
There is no '/' or '|' syntax. You have to use a delimiter there, you can
even use 'a' for it, if there is no 'a' in your pattern (it could work,
but it wouldn't do what you want).
I personally use '!' as delimiter, it's just personal preference..
> Did you mean to drop the ".latex" here?
Yes, it might be conceivable that there is some other language that has
the same constructs and it would work for that as well..
More information about the textmate-dev