| 1 | #! /bin/sh |
| 2 | # File: ctan_chk_bash |
| 3 | # Why: Creates the ctan_chk.gawk and ctan_chk.pdf from the ctan_chk.w ``literate program'' |
| 4 | # How to run: from bash command-terminal |
| 5 | # . ctan_chk_bash |
| 6 | # |
| 7 | echo "----------->ctan_chk_bash script<-----------" |
| 8 | echo "----------->cweave create the pdf doc of ctan_chk<-----------" |
| 9 | cweave ctan_chk |
| 10 | pdftex ctan_chk |
| 11 | echo "----------->ctangle create ctan_chk.gawk program<-----------" |
| 12 | ctangle -l +e ctan_chk.w |
| 13 | echo "----------->sed - change section no into a gawk comment<-----------" |
| 14 | sed 's/^\/\*/# section no/' ctan_chk.gawk>ctan_chk.tmp |
| 15 | echo "----------->gawk --- remove empty lines and #line lines<-----------" |
| 16 | gawk -e '{r=length($0);if(r==0) next; match($0,/^(\#line|;)/);if (RLENGTH > 0) next; print $0;}' ctan_chk.tmp > ctan_chk.tm1 |
| 17 | echo "----------->cp --- create the gawk edited program<-----------" |
| 18 | cp ctan_chk.tm1 ctan_chk.gawk |
| 19 | echo "----------->remove temporary files<-----------" |
| 20 | rm ctan_chk.tmp |
| 21 | rm ctan_chk.tm1 |
| 22 | rm *.idx |
| 23 | rm *.scn |
| 24 | rm *.toc |
| 25 | rm *.tex |
| 26 | rm *.log |
| 27 | rm *.c |
| 28 |