Title: | Batch Script Helpers |
---|---|
Description: | Handy frameworks, such as error handling and log generation, for batch scripts. Use case: in scripts running in remote servers, set error handling mechanism for downloading and uploading and record operation log. |
Authors: | Sherry Zhao |
Maintainer: | Sherry Zhao<[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2024-11-16 04:03:31 UTC |
Source: | https://github.com/sherrisherry/batchscr |
See arguments.
ecycle(code, ehandle, max_try, thandle, ecorrect, cond = TRUE)
ecycle(code, ehandle, max_try, thandle, ecorrect, cond = TRUE)
code |
The code block to run |
ehandle |
The code block to run when running |
max_try |
The number of attempts to run |
thandle |
(Optional) The code block to run when running |
ecorrect |
(Optional) The code block to run after running |
cond |
(Optional) Additional conditions for deciding that running |
If running code
fails, the result of ehandle
.
If running code
succeeds and thandle
is missing, the result of code
.
If running code
succeeds and thandle
isn't missing, the result of thandle
.
ecycle({a <-1; print(a+b); b <- 2}, print('failed'), 3, print('succeeded'), b <- 3) print(b)
ecycle({a <-1; print(a+b); b <- 2}, print('failed'), 3, print('succeeded'), b <- 3) print(b)
See arguments.
mklog(x, path, sep = '\t')
mklog(x, path, sep = '\t')
x |
Content of a log record. |
path |
The path of the log file, if ”, the log record is sent to standard output. |
sep |
The seperator in a record. |
None (invisible NULL)
mklog('test log', '')
mklog('test log', '')