Open aschersleben opened 3 years ago
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...
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 byrunOSCommand(...)
. In https://github.com/mllg/batchtools/commit/75a5b701341c6937c779ce395fe9367dbee99c15 you removed theshQuote
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 thenodename
variable)Created on 2020-07-17 by the reprex package (v0.3.0)
Can you reproduce this?