in reply to In place replace, ignoring between quotes

Another approach (not the fastest) relying on Text::ParseWords to split the command into "words" (hopefully) like shell does:
$ perl -MText::ParseWords=quotewords -nle 'print join " ", map { $_ eq + ";" ? "&&" : $_ } quotewords qr/\s+/, 1, $_' cd / ; /path/to/R/R_latest --vanilla --args "fName='rGSDPlan';jobCode= +682718;jobId=6827181;" < job682718.R > job_6827181.txt cd / && /path/to/R/R_latest --vanilla --args "fName='rGSDPlan';jobCode +=682718;jobId=6827181;" < job682718.R > job_6827181.txt