Desktop Survival Guide
by Graham Williams

Running System Commands

You can ask the operating system to perform a command with the system command:

> system("sleep 10")		 # Run OS command sleep with argument 10
> system("sleep 10", wait=FALSE) # Run OS command but don't wait (MS/Windows)
> system("sleep 10 &")           # Run OS command but don't wait (GNU/Linux)
> l <- system("ls", intern=TRUE) # Run OS command and collect output

Copyright © Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
The PDF version is a formatted comprehensive draft book (with over 800 pages).
Brought to you by Togaware. This page generated: Sunday, 22 August 2010