1 2 3 4 5 6 7 8 9 10 11
#!/bin/sh set -eu echo "#include <${1}>" | cc ${CFLAGS:-} -E -x c - | sed -En ' /^# [0-9]+ "[^<]/{ s/.*"([^"]+)".*/\1/p q } '