R code to make shellscripts