summary refs log tree commit diff
path: root/home/.local/bin/whinclude
blob: 26445cdc464820def91f3738c541ec4164328afb (plain) (blame)
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
	}
'