System (awk) command saved as a variables error

I am having the following error:

a <- system("awk '{ if (/foo/) print "2","\t",$0; else print "1","\t",$0; }' file",intern=true)

However, I am getting the following error:

Error: unexpected numeric constant in "a \<- system("awk '{ if (/foo/) print "2"

I am wondering if I have to escape the internal apostrophe's but not sure how?!



Comments

Popular posts from this blog

Spring Elasticsearch Operations

Object oriented programming concepts (OOPs)

Network Error and Timeout on Authorize.net JS