#!/usr/bin/env sh # Generate a tesh file from a given command (simple case). command="$1" output=$(sh -c "$command" 2>&1) return=$? tesh="#!/usr/bin/env tesh ! expect return $return $ $command $(echo "$output" | sed 's/^/> /' ) " echo "$tesh" echo "$tesh" | tesh 1>&2