+#### FreeBSD script, e.g., doesn't use -c to identify a command to run.
+if script -c 'echo OK' /dev/null 2>&1 | egrep 'OK' >/dev/null; then
+ script_command_opt='-c'
+else
+ script_command_opt=''
+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() {
+ if [ "$script_command_opt" = -c ]; then
+ #### -c takes single argument with command + arguments.
+ script -q -f -c "$*" "$actual" >/dev/null &
+ else
+ #### E.g., FreeBSD. Don't combine command arguments.
+ script -q -t 0 "$actual" "$@" >/dev/null &
+ fi
+
+ wait $!
+}