bash.sh 233 B

12345678
  1. #!/bin/bash
  2. logFile=$(cygpath -u "$1" 2> /dev/null)
  3. command=$2
  4. shift 2
  5. [[ -z $logFile || -z $command ]] && exit 1
  6. script -eqf --command "/usr/bin/bash -o pipefail -lc '$command $*'" /dev/null | tee "$logFile"
  7. exit "${PIPESTATUS[0]}"