diff options
| author | Michael Forney <mforney@mforney.org> | 2020-06-04 19:11:30 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2020-06-04 19:42:34 -0700 |
| commit | 785b495ba77ee716740523df566c560c63b4ddcc (patch) | |
| tree | 7fddfcdc93598178c685507779fe9b45eae31b9f /scripts/probe.sh | |
| parent | b39004f210b110a4e9d77edf12012f8a4376da49 (diff) | |
Save stderr of probe commands
Diffstat (limited to 'scripts/probe.sh')
| -rw-r--r-- | scripts/probe.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/probe.sh b/scripts/probe.sh index 093a16dc..cf306110 100644 --- a/scripts/probe.sh +++ b/scripts/probe.sh @@ -1,12 +1,13 @@ set -e -if [ "$#" -lt 2 ] ; then - echo 'usage: probe.sh var command...' >&2 +if [ "$#" -lt 3 ] ; then + printf 'usage: %s var out command...\n' "$0" >&2 exit 2 fi var=$1 -shift -if "$@" 2>/dev/null ; then - echo "#define $var 1" +out=$2 +shift 2 +if "$@" 2>"$out.log" ; then + echo "#define $var 1" >"$out" fi |
