Status of The Last run Command

$status contains the status code of the last executed run command.

Examples

Print status code of run :

1
2
3
4
5
@test "Example" {
  run cat nonexistent_filename
  echo "Status: $status" >&3
  echo "Output: $output" >&3
}
BashSupport Pro is a Bash IDE with support for $status – try it now!
© 2020–2022 Joachim Ansorg
Imprint
Privacy Policy
Legal