# NOT RUN {
## Different examples for Unix and Windows
# }
# NOT RUN {
if (.Platform$OS.type == "unix") {
run("ls")
system.time(run("sleep", "10", timeout = 1,
error_on_status = FALSE))
system.time(
run(
"sh", c("-c", "for i in 1 2 3 4 5; do echo $i; sleep 1; done"),
timeout = 2, error_on_status = FALSE
)
)
} else {
run("ping", c("-n", "1", "127.0.0.1"))
run("ping", c("-n", "6", "127.0.0.1"), timeout = 1,
error_on_status = FALSE)
}
# }
Run the code above in your browser using DataLab