-require_prog script
-if script -S /bin/sh 'echo OK' /dev/null 2>&1 | egrep 'OK' >/dev/null; then
- #### script(1) uses -S to set the shell that it runs.
- use_dash_S=1
-else
- #### Assume that script(1) uses SHELL environment variable.
- use_dash_S=0
-fi
-
-#### Run a command but don't wait for user input. script(1) seems to do
-#### what we want by not waiting when run in the background.
-run_without_input() {
- #### Create a command to use as a shell for script.
- cat >"${cmd}" <<EOF
-#! /bin/sh
-$*
-EOF
- chmod +x "${cmd}"
-
- if [ ${use_dash_S} -eq 1 ]; then
- script -S "${cmd}" "$actual" >/dev/null &
- else
- SHELL="${cmd}" script "$actual" >/dev/null &
- fi
-
- wait $!
-}
-
-actual="$MH_TEST_DIR/test-version-check$$.actual"