#!/bin/sh set -e cfile=/tmp/valueof.$$.c include="$1" var="$2" cat > $cfile < #include <$include> int main() { printf("$var=%d\n", $var); return 0; } END gcc -w $cfile -o $cfile.bin $cfile.bin rm $cfile*