summaryrefslogtreecommitdiff
path: root/scripts/probe.sh
blob: ac5b39885ad43bab41836f78734e7868bad91f9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
set -e

if [ "$#" -lt 3 ] ; then
	printf 'usage: %s var out command...\n' "$0" >&2
	exit 2
fi

var=$1
out=$2
shift 2
if "$@" 2>"$out.log" ; then
	echo "#define $var 1"
fi >"$out"