I have raised this in the past, the solution I would like to see is something like getopts. However the following offers a possible solution. FILE: Rba --------------------------------------------------- #!/bin/sh ## ## ARG 1 is the R program to RUN ## rest of line are arguments if [ $# -eq 0 ] ; then echo echo "usage: Rba RPROGRAM.r ARG1 ARG2 ...." echo exit fi program=$1 shift cmdargs=$* gtime R --quiet \ --no-save \ $cmdargs < $program ----------------------------------------------------- Inside your R function/program/module you access command line arguments 'userargs'. EXAMPLE ----------------------------------------------------- # set parameters from commandline inputfile<-userargs[4] outputfile<-userargs[5]