1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/bash for i in "$@"; do n=$(basename "$i" .txt|sed -e 's/s$//') if test "$n" == "shortfile"; then continue; fi echo "enum tpf_$n" echo "{" while read j; do echo $'\t'"TPF_${n}_$j", done < "$i" |tr '[a-z]' '[A-Z]'|tr ' ' '_' echo $'\t'"TPF_${n}_COUNT"|tr '[a-z]' '[A-Z]' echo "};" echo done