In Rstudio (Mac desktop) I can execute the following command and it works fine.
system("pushd data_out; zip -r myfile.zip myfile.csv; popd")
The basics are that from the current directory it will go into the data_out
directory and zip myfile.csv
into the file myfile.zip
and then return to the original directory. This is a wonderful time saver for workflow meaning I can programatically create output files to pass on to other users.
I've recently started using the Server Version of RStudio and for some reason the pushd
and popd
commands don't work. I understand that these commands are bash
commands. I'm wondering if there is a way to get pushd
and popd
to work in the server version, eg defining which shell to use.
Currently I've adjusted my command to the following which is working.
system("cd data_out; zip -r myfile.zip myfile.csv; cd ..")