entering variable interactively in a bash script with R system() function

Viewed 26

I have a bash script using the read function. When calling it in Rstudio, that is doing system("the script") if I understood to documentation correctly, the script starts.

But when it ask me for input, I write and push enter, but the scripts does not go on, it did not interpret the enter as giving the answer.

Is there a trick to know, or is this just not possible ?

The minimal example, this is a .sh file open in RStudio, I push the run command:

#!/usr/bin/env bash

echo "start: give answer "  
read commitmessage 

echo "answer read "  
0 Answers
Related