#!/bin/sh

find examples tests -type d \( -name "googletest-read-only" -or -name "rforge-nwfscassmt" -or -name "rforge-glmmadmb" -or -name "xml" -or -name "uml" -or -name "kalmanfilter" \) -prune -or -type f ! -empty -and ! \( -name "bugs.txt" -or -name "*.save" -or -name "cerr.txt" -or -name "README" -or -name "*.R" -or -name "*.r" -or -name "priors_user_guide.txt" -or -name "*.m" -or -name "*.py" -or -name "README.txt" -or -name "mixture.txt" -or -name "mixture.sav" -or -name "NEWT.CPP.ORIG" -or -name "robust.txt" -or -name "rob_reg.sav" -or -name "examples.txt" -or -name "*.s" -or -name "*.dat" -or -name "*.DAT" -or -name "*.bat" -or -name "*.h" -or -name "*.mak" -or -name "GNUmakefile" -or -name "Makefile" -or -name "*.html" -or -name "*.cpp" -or -name "*.htp" -or -name "*.obj" -or -name "*.tpl" -or -name "*.pdf" -or -name "*.bar" -or -name "*.bgs" -or -name "*.bar" -or -name "admodel.cov" -or -name "admodel.hes" -or -name "hessian.bin" -or -name "*.b01" \) -exec file '{}' \; | grep "ASCII text" | awk '{print $1}' | sed 's/:$//g' > outputs-list.txt
while read line; do printf "\n\n===> "; echo $line | sed 's/\//:/g'; cat $line; done < outputs-list.txt > outputs-all.txt
