I tried to find a solution for this for a while, but so far have not found anything satisfactory. I write a lot of bash scripts, but sometimes I want to use R or Python as part of a script. Right now I have to write two scripts; the original bash script to complete the first half of the task, and the R or Python script to complete the second half of the task. I am calling an R / Python script from a bash script.
I am not satisfied with this solution because it splits my program into two files, which increases the likelihood of exiting synchronization, more files to track, etc. Is there a way to write a block of text that contains my entire R / Python script and then bash spit it out into a file and pass arguments to it and execute it? Is there an easier solution? This is more complicated than porting simple single-line to R / Python, since it usually involves creating and managing objects in stages.
source
share