bash_job: bash job using conda env

bash_jobR Documentation

bash job using conda env

Description

The conda setup is assumed to be in your ~/.bashrc If print_output == TRUE: the stdout/stderr will be printed instead of returned Else: the stdout/stderr with be returned by the function stderr/stdout is printed unless print_output==FALSE

Usage

bash_job(
  cmd,
  conda_env = NULL,
  stdout = TRUE,
  stderr = TRUE,
  print_output = TRUE,
  return_output = FALSE,
  log_file = NULL,
  verbose = TRUE,
  wait = TRUE
)

Arguments

cmd

The bash command in a string format

conda_env

The conda env to use

stdout

If TRUE, print the stdout; if file path, write to file

stderr

If TRUE, print the stderr; if file path, write to file

print_output

Pretty printing of the output to the console?

return_output

Return the bash command output?

verbose

Write status messages?

wait

Wait for the process to finish?

Examples

# simple
bash_job('ls -thlc')
# write stderr to log file
bash_job('ls -thlc', stderr='log.txt')
# use conda environment
bash_job('conda list', conda_env='base')
# return output
files = bash_job('find . -name \\"*ipynb\\"', return_output=TRUE, print_output=FALSE, verbose=FALSE)

leylabmpi/LeyLabRMisc documentation built on Nov. 3, 2022, 3:45 p.m.