Working code to handle the problem in R
Correction
Rprot output for executing task solely in R
Testing shell commands