Last chance! 50% off unlimited learning
Sale ends in
# NOT RUN {
test <- "abc$def`gh`i\\j"
cat(shQuote(test), "\n")
# }
# NOT RUN {
system(paste("echo", shQuote(test)))
# }
# NOT RUN {
test <- "don't do it!"
cat(shQuote(test), "\n")
tryit <- paste("use the", sQuote("-c"), "switch\nlike this")
cat(shQuote(tryit), "\n")
# }
# NOT RUN {
system(paste("echo", shQuote(tryit)))
# }
# NOT RUN {
cat(shQuote(tryit, type = "csh"), "\n")
## Windows-only example, assuming cmd.exe:
perlcmd <- 'print "Hello World\\n";'
# }
# NOT RUN {
shell(shQuote(paste("perl -e",
shQuote(perlcmd, type = "cmd")),
type = "cmd2"))
# }
Run the code above in your browser using DataLab