Thanks to visit codestin.com
Credit goes to github.com

Skip to content

sagiegurari/scriptexec

Repository files navigation

scriptexec

CRAN_Status_Badge GitHub release Build Status AppVeyor Build Status codecov
License Downloads Rdoc

Run complex native scripts with a single command, similar to system commands.

Overview

The purpose of the scriptexec package is to enable quick and easy way to execute native scripts.

Usage

Simply load the library and invoke the execute

library(scriptexec)

# execute script text
output <- scriptexec::execute("echo Current Directory:\ndir")
cat(sprintf("Exit Status: %s Output: %s\n", output$status, output$output))

# execute multiple commands as a script
output <- scriptexec::execute(c("cd", "echo User Home:", "dir"))
cat(sprintf("Exit Status: %s Output: %s\n", output$status, output$output))

# pass arguments to the script, later defined as ARG1, ARG2, ...
# and also pass some env vars
output <- scriptexec::execute("echo $ARG1 $ARG2 $MYENV", args = c("TEST1", "TEST2"), env = c("MYENV=TEST3"))
cat(sprintf("%s\n", output))

# non zero status code is returned in case of errors
output <- scriptexec::execute("exit 1")
cat(sprintf("Status: %s\n", output$status))
cat(sprintf("%s\n", output))

# do not wait for command to finish
scriptexec::execute("echo my really long task", wait = FALSE)

Installation

Install from CRAN:

install.packages("scriptexec")

Install latest release from github:

devtools::install_github("sagiegurari/[email protected]")

Install current development version from github (might be unstable):

devtools::install_github("sagiegurari/scriptexec")

API Documentation

See full docs at: API Docs

Contributing

See contributing guide

Release History

See NEWS

License

Developed by Sagie Gur-Ari and licensed under the Apache 2 open source license.

About

Run complex native scripts with a single command, similar to system commands.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published