Re: [R] system2 commands with backslash

2013-10-11 Thread Zev Ross
Thanks to Henrik and David for responses. Both were right. A small edit to my description of the problem (which has now been solved). I said that the first version of system2 ( system2("sed -i s/oldword/newword/g d:/junk/x/test.tex")) worked fine but in fact it was not working, it just wasn't g

Re: [R] system2 commands with backslash

2013-10-11 Thread Henrik Bengtsson
system2("sed", args=c("-i", "s/oldword\\s/newword/g", "d:/junk/x/test.tex")) /Henrik On Fri, Oct 11, 2013 at 8:58 AM, David Winsemius wrote: > > On Oct 10, 2013, at 8:16 AM, Zev Ross wrote: > >> Hi All, >> >> I'm trying to edit a file in place using system2 and sed from within R. I >> can get m

Re: [R] system2 commands with backslash

2013-10-11 Thread David Winsemius
On Oct 10, 2013, at 8:16 AM, Zev Ross wrote: > Hi All, > > I'm trying to edit a file in place using system2 and sed from within R. I can > get my command to work unless there is a backslash in the command in which > case I'm warned about an "unrecognized escape". So, for example: > > system2(

[R] system2 commands with backslash

2013-10-10 Thread Zev Ross
Hi All, I'm trying to edit a file in place using system2 and sed from within R. I can get my command to work unless there is a backslash in the command in which case I'm warned about an "unrecognized escape". So, for example: system2("sed -i s/oldword/newword/g d:/junk/x/test.tex") # works fi