Script started on Thu Feb 23 19:24:52 2017 ------------------------------------------------ luser@[/home/luser/USB/KJV-PlainText-Books/GET-WHO-WHERE] ------------------------------------------------ Script started, file is process-to-find-KeyWords.RAW 1) cp *.txt NO-NU ------------------------------------------------ 2) manually numbered files 01-66 (mv Gen.txt 01_Gen.txt) ls *.txt > addnumbers vi addnumbers :%s/.*/cp & 00_&/g :wq sh ./addnumbers mkdir NO-NUM mkdir NUM mv ??_*.txt NUM mv *.txt NO-NUM cd NUM cp 01_Gen.txt 01_Gen-words.txt # (department of redundancy department) ------------------------------------------------ perl -pi -e 's/ /\n/g' 01_Gen-words.txt ------------------------------------------------ test file: ------------------------------------------------ --> head 01_Gen-words.txt Gen 1:1 In the beginning God created the heaven and ------------------------------------------------ --> cat 01_Gen-words.txt | sort | uniq > sorted_01_gen-words.txt ------------------------------------------------ --> cat sorted_01_gen-words.txt | wc -l 5929 ------------------------------------------------ # now eliminate lower case words and numbers cat sorted_01_gen-words.txt | grep -v ^[a-z] | grep -v ^[0-9] > sorted-list-uppercase-only_01_gen.txt # now eliminate commas (and a few other items not shown) ------------------------------------------------ --> perl -pi -e 's/,//g' sorted-list-uppercase-only_01_gen.txt ------------------------------------------------ --> cat sorted-list-uppercase-only_01_gen.txt | wc -l 1013 ------------------------------------------------ --> cat uppercase-gen01-only.txt | wc K-l 658 ------------------------------------------------ perl -pi -e 's/,//g' sorted-list-uppercase-only_01_gen.txt cat sorted-list-uppercase-only_01_gen.txt | wc -l perl -pi -e 's/\.//g' sorted-list-uppercase-only_01_gen.txt cat sorted-list-uppercase-only_01_gen.txt | wc -l perl -pi -e 's/;//g' sorted-list-uppercase-only_01_gen.txt cat sorted-list-uppercase-only_01_gen.txt | sort | uniq perl -pi -e 's/\?//g' sorted-list-uppercase-only_01_gen.txt perl -pi -e 's/://g' sorted-list-uppercase-only_01_gen.txt perl -pi -e 's/(//g' sorted-list-uppercase-only_01_gen.txt perl -pi -e 's/\(//g' sorted-list-uppercase-only_01_gen.txt perl -pi -e 's/\)//g' sorted-list-uppercase-only_01_gen.txt cat sorted-list-uppercase-only_01_gen.txt | sort | uniq > uppercase-gen01-only.txt cat uppercase-gen01-only.txt | wc -l # create a script that loops through uppercase words only to print out lines --> more grep-from-upper.sh #!/bin/bash OUT="Who-Genesis.txt" for x in `cat uppercase-gen01-only.txt` do echo $x | tee -a $OUT echo "------------------------" | tee -a $OUT grep $x 01_Gen.txt | tee -a $OUT echo "------------------------" | tee -a $OUT done ------------------------------------------------ sh ./grep-from-upper.sh Abel ------------------------ Gen 4:2 And she again bare his brother Abel. And Abel was a keeper of sheep, but Cain was a tiller of the ground. Gen 4:4 And Abel, he also brought of the firstlings of his flock and of the fat thereof. And the LORD had respect unto Abel and to his offering: Gen 4:8 And Cain talked with Abel his brother: and it came to pass, when they were in the field, that Cain rose up against Abel his brother, and slew him. Gen 4:9 And the LORD said unto Cain, Where is Abel thy brother? And he said, I know not: Am I my brother's keeper? Gen 4:25 And Adam knew his wife again; and she bare a son, and called his name Seth: For God, said she, hath appointed me another seed instead of Abel, whom Cain slew. Gen 50:11 And when the inhabitants of the land, the Canaanites, saw the mourning in the floor of Atad, they said, This is a grievous mourning to the Egyptians: wherefore the name of it was called Abelmizraim, which is beyond Jordan. ------------------------ Abelmizraim ------------------------ Gen 50:11 And when the inhabitants of the land, the Canaanites, saw the mourning in the floor of Atad, they said, This is a grievous mourning to the Egyptians: wherefore the name of it was called Abelmizraim, which is beyond Jordan. ------------------------ Abidah ------------------------ Gen 25:4 And the sons of Midian; Ephah, and Epher, and Hanoch, and Abidah, and Eldaah. All these were the children of Keturah. ------------------------ Abimael ------------------------ Gen 10:28 And Obal, and Abimael, and Sheba, ------------------------ Abimelech ------------------------ ------------------------ Zuzims ------------------------ Gen 14:5 And in the fourteenth year came Chedorlaomer, and the kings that were with him, and smote the Rephaims in Ashteroth Karnaim, and the Zuzims in Ham, and the Emins in Shaveh Kiriathaim, ------------------------ ------------------------------------------------ --> exit exit Script done on Thu Feb 23 19:51:19 2017 mv uppercase-gen01-only.txt WHO-or-WHERE-in-Genesis.txt #!/bin/bash OUT="Who-Genesis.txt" for x in `cat uppercase-gen01-only.txt` do echo $x | tee -a $OUT echo "------------------------" | tee -a $OUT grep $x 01_Gen.txt | tee -a $OUT echo "------------------------" | tee -a $OUT done