exec("R", "and", "some", "args"); # $pid will be the R command exec("R and some args > out"); # $pid will be that of a shell