You can do echo "print('hello world')" | Rscript --slave -
echo "print('hello world')" | Rscript --slave -