Doing it with Windows

Having fun — or Not

OK….does bash work with windows?

First, check if the following works at the R prompt.

Sys.which('bash')
                              bash 
"C:\\PROGRA~2\\Git\\bin\\bash.exe" 

Cool! It looks like I am good to go.

Now we will print the working directory from bash.

pwd
/c/Users/Alan/repos/SEMINAR/Alan/summaries/shell

To see if sh will work, test to see if it is found on your system.
I have Rtools installed on my system. You may want to install Rtools if you have not already.

Sys.which('sh')
                          sh 
"c:\\R\\Rtools\\bin\\sh.exe" 

Hot dog! This is working. Issue some commands to see what is in the working directory.

ls -a
.
..
WindowsCheck.Rmd
WindowsCheck.html
WindowsCheck.md

Maybe a little more information. Note: -al lists details for hidden and unhiddn files and folders.

ls -al
total 448
drwx------+ 1 Alan mkpasswd      0 Jan 15 08:45 .
drwx------+ 1 Alan mkpasswd      0 Feb  3  2014 ..
-rwx------  1 Alan mkpasswd   1139 Jan 15 08:46 WindowsCheck.Rmd
-rwx------  1 Alan mkpasswd 438509 Jan 15 08:45 WindowsCheck.html
-rwx------  1 Alan mkpasswd   1765 Feb  3  2014 WindowsCheck.md

touch creates an empty file

touch NewFile
ls
NewFile
WindowsCheck.Rmd
WindowsCheck.html
WindowsCheck.md
rm NewFile
ls
WindowsCheck.Rmd
WindowsCheck.html
WindowsCheck.md

What time is it?

date
Thu Jan 15 08:47:00 EST 2015