multicmd - Run multiple commands in series



NAME

multicmd - Run multiple commands in series


SYNOPSIS

multicmd [OPTIONS] [--] COMMAND-1 ARGS-1 ";" COMMAND-2 ARGS-2 ";" ...

Run COMMAND-1, COMMAND-2, ... COMMAND-n after each other, similarly like shells would do, except not involving any shell.


OPTIONS

-d, --delimiter STRING

Set command delimiter to STRING. Default is a literal ; semicolon. Probably need to shell-escape. If you want -- (double dash) for delimiter, to avoid confusion, put it as: --delimiter=--.

-e, --errexit

Exit if a command did not run successfully (ie. non-zero exit status or signaled) and do not run further commands. Similar to bash(1)'s errexit (set -e) mode. multicmd(1)'s exit code will be the failed command exit code (128+n if terminated by a signal n).


CAVEATS

Note, that ; (or the non-default delimiter set by --delimiter) is a shell meta-char in your shell, so you need to escape/quote it, but it's a separate literal argument when you call multicmd(1) in other layers (eg. execve(2)), so don't just stick to the preceding word. Ie:

WRONG: multicmd date\; ls

WRONG: multicmd 'date; ls'

WRONG: multicmd 'date ; ls'

CORRECT: multicmd date \; ls

CORRECT: multicmd date ';' ls


EXIT STATUS

multicmd(1) exit with the exit code of the last command.

 multicmd - Run multiple commands in series