On 2011-04-21 14:35, Marius Hofert wrote:
Now when I executed the command, a lot of weird things happened
First a caveat. I know nothing about R. I'd never even heard of it before your question. I only installed the bundle briefly to see what it was doing, then deleted it. So I can't help you with the specifics there.
But, there were a couple things wrong with what I sent. Serves me right for not posting exactly what I tested... First, I had spaces around the equals sign in the assignment, which is a no-no in shell syntax. Second, at least in my test script, I had failed to quote the the $rawText variable in the echo command, which ended up stripping the newlines. Here's my full test script cut'n'pasted straight from the bundle editor, and a screen shot of the output.
#! /bin/sh rawText="`head -$(($TM_LINE_NUMBER-1))`" echo "<pre>" "$rawText" "</pre>" | cat
The "<pre>" wrapper is to get the newlines to show up in the HTML output window; you'll want to eliminate that. The '| cat' here is a placeholder for the 'osascript' command the R bundle script is calling. You'll need to keep the echo command as it is in the bundle (perhaps adding quotes around "$rawText" if they're not already there.) In the screen shot the cursor is in the middle of the word "dolore" on line 11. I added some punctuation to the text to make sure that special characters came through okay. The HTML output window shows what would be passed on to the command in the R bundle if I still had that installed.
I hope it works for you this time around!