Within R for Mac I'm trying to create a bash file that, by double clicking outside of R, creates folders in a specific path directory set within R. The number of folders should be equal to a vector (set within R). This following code works within R for windows, but just replacing the extension ".bat" to ".sh" doesn't seem to work.
vec <- c(1,1,1)
bat<-matrix(nrow=length(vec),ncol=2,0)
for (i in 1:length(vec)){
bat[i,1]<-"md"
bat[i,2]<-gsub("/","/",paste(saveloc,"/",vec[i],sep=""),fixed=T)
}
write.table(bat,paste(saveloc,"/","individual names.bat",sep=""),sep=" ",dec=dec,row.names=F,col.names=F,quote=2)
"Saveloc" is the path directory. Any ideas how I can make this happen on a mac?
Any help is greatly appreciated.