I am spinning up a linux virtual environment which is missing the needed drivers, so I am using the shell to install. I am doing this manually but would like to automate it from within R, where the rest of my code is.
I am able to open the shell in R by clicking on Tools>Shell...
I then have multiple lines of Bash script to run in order to install the "ODBC Driver 17 for SQL Server"
sudo su
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list
exit
sudo apt-get update
sudo ACCEPT_EULA=Y apt-get install msodbcsql17
I would like to save these commands in some sort of readable file and run this from within R.
After some search I have seen posts that use System to run a single line but I have not been able to find information on if/how this can be extended to run multiple lines or how to pull these commands from some sort of saved file.
Context: I am new to linux and Bash/Shell commands Thank you!