In a recent posting to r-devel, Prof. Brian Ripley of R-Core announced an interesting development (pun intended) for future versions of R. Several of the core utility scripts, such as INSTALL and REMOVE, have been converted from sh scripts or Perl into native R code.
#! /usr/bin/Rscript --vanilla --default-packages=utils
args <- commandArgs(TRUE)
res <- try(install.packages(args))
if(inherits(res, "try-error")) q(status=1) else q()