Skip to content
Prev 29496 / 63424 Next

shQuote and cat

Vadim Organovich wrote:
But you were running on Windows, so the default shell is CMD, not bash.  
shQuote doesn't support bash specifically, but I imagine it uses the 
same quoting rules as sh, so you should use shQuote('"a"', type="sh").  
On my machine that gives '"a"', and echo '"a"' prints "a" as you wanted.

I don't think you want to quote the "echo" in the command, only the 
string that you want it to print, i.e. for the full command you should use

 > cat(paste("echo", shQuote('"a"', type="sh")))
echo '"a"'

Duncan Murdoch