my $Rpath = "\\user\\R\\rw\\bin\\" ; my $Rcmd = $Rpath . "rterm --vanilla --quiet --slave" ; my $Rscript = "whatever R commands"; $Rscript =~ s/(\r|;\r)/ ;/gm ; $Rscript =~ s/<-/=/gm; # \r or <- will break "echo" print `echo $Rscript | $Rcmd`; # execute R commands & print results