invoke.sh 231 B

123456789101112131415
  1. #!/bin/bash
  2. set -eo pipefail
  3. exit_code=0
  4. echo "running $* 1>out 2>err"
  5. $* <i 1>out 2>err || exit_code=$?
  6. echo exit_code="$exit_code"
  7. echo -- out --
  8. cat out
  9. echo -- err --
  10. cat err
  11. echo -- --- --
  12. rm -f out
  13. rm -f err