In order : launch new terminal, launch R environment in the new terminal, execute commands in R environment
问题 I would like a shell script that launches a new terminal, opens the R environment in the terminal and executes commands in the R environment of the new terminal. Here's what I did which is not working : #!/bin/sh for i in $(seq 25) do gnome-terminal -x sh "R; source('source.r'); function($i)" done Where, function() is an r function in the file "source.r" Please help. N.B. I don't want to launch the program using the command "Rscript" EDIT 1 : I don't want to use the command Rscript because