Execute arguments as command

Runs the arguments as a command and then stores output and exit status into special global variables. It returns with status code 0 to help making assertions in your test case.

Usage

-0 to -255Expect that the command exits with the given exit status.
!Expect that the command exits with a non-zero exit status.
--keep-empty-linesKeep empty lines in ${lines[0]}.
--separate-stderrStore STDOUT in $output and STDERR in $stderr. Lines are stored in $lines and $stderr_lines.

Examples

Executing a command with run
1
2
3
@test "executing a command with run" {
    run -0 command -v bash
}
BashSupport Pro ist eine Shell-Skript-IDE mit Unterstützung für run von bats-core - probieren Sie es jetzt aus!
© 2020–2024 Joachim Ansorg
Impressum
Datenschutz
Rechtliches