Мне нужно запустить .sh скрипт из R на Windows.
Для этого я попытался вызвать исполняемый файл cygwin. Вот мой код:
## Define the path to the script .sh and parameters
scriptPath <- "D:/script.sh"
parameters <- c("D:/test/results_","D:/test_text/results_","1","2")
## Define arguments
all_arguments <- c(scriptPath, parameters)
## Run the .sh script
command <- "C:/cygwin64/bin/bash.exe"
output <- system2(command, args=all_arguments, stdout=TRUE)
output
Однако, у меня есть это сообщение об ошибке: "D:/script.sh: line 33: seq: command not found"
.
Вот строка 33:
for i in $(seq -f "%04g" $step $step $num_end);
В Linux скрипт работает. Любая помощь будет принята с благодарностью.