-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
runOSCommand throws error with R 4.0 (missing shQuote) #264
Comments
I was just opening another issue, but I see it is already found. My lazy repro is: doesn't work args <- c("-e", shQuote("message(\"[bt] --BOF--\\n\", \"[bt] \", system.file(\"bin/linux-helper\",
package = \"batchtools\"), \"\\n[bt] --EOF--\\n\")"))
command <- sprintf("%s %s", "Rscript", stringi::stri_flatten(args, " "))
# command = shQuote(command)
command <- stringi::stri_replace_all_fixed(command, "\\$", "$")
sys.args <- c("-q", "myremotehost", command)
sys.cmd <- "ssh"
res <- suppressWarnings(system2(command = sys.cmd, args = sys.args, stdin = "",
stdout = TRUE, stderr = TRUE, wait = TRUE))
output <- as.character(res)
output
[1] "bash: -c: line 0: syntax error near the symbol \"(\" unexpected" works args <- c("-e", shQuote("message(\"[bt] --BOF--\\n\", \"[bt] \", system.file(\"bin/linux-helper\",
package = \"batchtools\"), \"\\n[bt] --EOF--\\n\")"))
command <- sprintf("%s %s", "Rscript", stringi::stri_flatten(args, " "))
command = shQuote(command)
# command <- stringi::stri_replace_all_fixed(command, "\\$", "$")
sys.args <- c("-q", "myremotehost", command)
sys.cmd <- "ssh"
res <- suppressWarnings(system2(command = sys.cmd, args = sys.args, stdin = "",
stdout = TRUE, stderr = TRUE, wait = TRUE))
output <- as.character(res)
output
[1] "[bt] --BOF--"
[2] "[bt] /usr/local/lib/R/site-library/batchtools/bin/linux-helper"
[3] "[bt] --EOF--"
[4] "" sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 20.04.2 LTS |
And now I'm here again "solving" the same issue... I forgot I've already had... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I'm working on a debian server and try to use
makeClusterFunctionsSSH(...)
to distribute jobs to other debian servers. It throws the following error:syntax error near unexpected token `('
The error is caused by
runOSCommand(...)
.In 75a5b70 you removed the
shQuote
for R 4.0 and higher. But as far as I was able to reproduce the error, thisshQuote
is still needed with R 4.0.2.MWE directly built from the code of
Worker
andrunOSCommand
:(you have to set the
nodename
variable)Created on 2020-07-17 by the reprex package (v0.3.0)
Can you reproduce this?
The text was updated successfully, but these errors were encountered: