first check-in of feisty meow codebase. many things broken still due to recent
[feisty_meow.git] / scripts / buildor / buildor_find_active_includes.sh
1 #!/bin/bash
2
3 # locates any #include declarations inside the files provided as parameters.
4 # all the includes are turned into their bare file names and sent to standard
5 # output.
6
7 TAB_CHAR=$'\t'
8
9 for code_file in $*; do
10   echo "$code_file includes:"
11   grep -i "^[ $TAB_CHAR]*#include" "$code_file" \
12       | sed -e "s/^[ $TAB_CHAR]*#include[ $TAB_CHAR]*[<\"]\(.*\)[>\"].*$/\1/" \
13       | tr A-Z a-z \
14       | sort | uniq | sort 
15 done
16