1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
#!/usr/bin/env sh
# Copyright (c) 2014-2025. The SimGrid Team. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the license (GNU LGPL) which comes with this package.
# 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
|