Skip to content

Instantly share code, notes, and snippets.

@kaneta1992
Last active August 26, 2016 07:30
Show Gist options
  • Save kaneta1992/64a23d19de18d1cc6a88528a8a061dec to your computer and use it in GitHub Desktop.
Save kaneta1992/64a23d19de18d1cc6a88528a8a061dec to your computer and use it in GitHub Desktop.
シェーダーの依存ファイルを調べたかった時に書いた
#!/bin/bash
IFS=$'\n'
declare -a KNOWN_LIST=()
function func() {
echo "${KNOWN_LIST[*]}" | grep $1 > /dev/null && return
KNOWN_LIST+=($1)
echo $1
for filename in $(cat $1 | grep "#include" | sed 's/'\''/"/g;' | cut -d'"' -f2); do
func $(echo $filename)
done
}
func $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment