examples of functions using grep (Global REgular exPression - g re p)
examples of functions using grep (Global Regular Expression) to show only ONE line of a file that matches the search.
This is a listing of functions ONLY as an example.
THIS WILL NOT WORK ON YOUR SYSTEM as these TEXT files are not on your system.
The plain text files in this directory may be copied to your local drive, create a "BIBLES" directory and place them there.
Additional plain text files may be found at:
http://johnmeister.com/BIBLE/BIBLES-for-text-searches/
Modify the path to the text files you have.
READ the man pages for grep to see what the options do, or simply experiment with the command to see what is shown.
CREATE an alias in your .bashrc file to see the functions you have created:
alias list-functions="grep function ~/.bashrc"
The example below only looks complicated, and most of these functions I rarely use, I leave them in my
.bashrc file as examples. Also, you can "pipe" ( | ) the results through another filter, and grep for
additional key words that might appear on the matching string. The last two functions provide an
example where an additional grep only listed passages that were NASB or NKJV, both of which are copyrighted
so I can not add those files to this site. However, if you have Bible software with a licensed copy then
you could create your own text file for searching.
The KJV file included in this directory is public domain, as are the foreign language versions.
the alias to see the functions in your .bashrc is executed by typing: list-functions
--> list-functions
alias list-functions="grep function ~/.bashrc"
function dir-mkcd () { mkdir -p "$@" && eval cd "\"\$$#\""; }
# functions - ###############################################################################
# function gz () { grep -B 2 -A 2 -i "$*" ~/BIBLES/GRK-NAS.txt;} ## NAS,LXX-GR-NA
function gz () { grep -C 2 -i "$*" ~/BIBLES/GRK-NAS.txt;} ## NAS,LXX-GR-NA
function gv () { grep -A 3 -B 2 -i "$*" ~/BIBLES/OTHER/NAS-VN.txt;} ## NAS-VN
function gvk () { grep -A 4 -B 2 -i "$*" ~/BIBLES/OTHER/NAS-VN-NKJV.txt;} ## NAS-VN-NKJV
function ga () { grep -A 4 -B 2 -i "$*" ~/BIBLES/AKDG.txt;} ## NAS,NKJV,DHS,GR-NA,GR-TR
function gzp () { grep -A 6 -B 4 -i "$*" ~/BIBLES/AKDG.txt;} ## NAS,NKJV,DHS,GR-NA,GR-TR
function gn () { grep -i "$*" ~/BIBLES/NAS.txt;} ## gn NAS - New American Std
function gk () { grep -i "$*" ~/BIBLES/KJV.txt;} ## gk KJV - KJV
function gw () { grep -i "$*" ~/BIBLES/NKJV.txt;} ## gw NKJV - New KJV
function gnf () { grep -i "$*" ~/BIBLES/NAS.txt | fold -s -w 80;} ## NAS 80 columns
function gnf100 () { grep -i "$*" ~/BIBLES/NAS.txt | fold -s -w 100;} ## NAS 100 columns
function gnf120 () { grep -i "$*" ~/BIBLES/NAS.txt | fold -s -w 120;} ## NAS 120 columns
function gn2 () { grep -C 2 -i "$*" ~/BIBLES/NAS.txt;} ## NAS context 2 lines
function gn3 () { grep -C 3 -i "$*" ~/BIBLES/NAS.txt;} ## NAS context 3 lines
function gn4 () { grep -C 4 -i "$*" ~/BIBLES/NAS.txt;} ## NAS context 4 lines
function gn5 () { grep -C 5 -i "$*" ~/BIBLES/NAS.txt;} ## NAS context 5 lines
function gn6 () { grep -C 6 -i "$*" ~/BIBLES/NAS.txt;} ## NAS context 6 lines
function gzak () { grep -A 4 -B 2 -i "$*" ~/BIBLES/OTHER/NkKDG.txt;} ## gz NAS,NKJV,KJV,DHS,Greek
function gey () { grep -A 3 -B1 -i "$*" ~/BIBLES/OTHER/SIX.txt;} ## NAS,NKJV,KJV,YLT,DHS,Greek
function gak () { grep -A 3 -B 1 -i "$*" ~/BIBLES/OTHER/NKDG.txt;} ## KJV,NAS,DHS,Greek
function gkn () { grep -C 1 -i "$*" ~/BIBLES/OTHER/KNb.txt;} ## KJV-NAS
function gnd3 () { grep -A 5 -B 4 -i "$*" ~/BIBLES/OTHER/ND.txt;} ## NAS and DHS context 3
function gz-nas-uncited () { grep -A 4 -B 2 -i "$*" ~/BIBLES/OTHER/ANKDG.txt;} ## NAS,NKJV,KJV,DHS,Greek
function gk3 () { grep -C 3 -i "$*" ~/BIBLES/KJV.txt;} ## KJV context 3 lines
function gknd () { grep -C 3 -i "$*" ~/BIBLES/OTHER/KND.txt;} ## KJV,NAS,DHS context 3
function gknn () { grep -A 2 -B2 -i "$*" ~/BIBLES/OTHER/KNN.txt;} ## KJV,NKJV,NAS
function gankdg () { grep -A 8 -B 3 -i "$*" ~/BIBLES/OTHER/ANKDG.txt;} ## NAS,NKJV,KJV,DHS,Greek
function gankdgl () { grep -A 4 -B 3 -i "$*" ~/BIBLES/OTHER/ANKDG.txt;} ## NAS,NKJV,KJV,DHS,Greek
function gnl () { grep -C 1 -i "$*" ~/BIBLES/OTHER/NNn.txt;} ## NAS-NKJV - no lines
function gank () { grep -A 2 -B2 -i "$*" ~/BIBLES/OTHER/ANK.txt;} ## NAS,NKJV,KJV
function g3 () { grep -A 2 -B2 -i "$*" ~/BIBLES/OTHER/NNK.txt;} ## NAS,NKJV,KJV
function g4 () { grep -A 2 -B2 -i "$*" ~/BIBLES/OTHER/NkKD.txt;} ## NAS,NKJV,KJV,DHS
function g5 () { grep -A 1 -B1 -i "$*" ~/BIBLES/OTHER/ANKDG.txt;} ## NAS-not-cited,NKJV,KJV,DHS,Greek
function g5c () { grep -A 2 -B2 -i "$*" ~/BIBLES/OTHER/NkKDG.txt;} ## NAS-cited,NKJV,KJV,DHS,Greek
function gef () { grep -i "$*" ~/BIBLES/OTHER/ENG.txt |fold -s -w 80;} ## NAS-NKJV-KJV - folded
function ge4 () { grep -i "$*" ~/BIBLES/OTHER/ENG4.txt;} ## NAS-NKJV-KJV-YLT
function gy () { grep -i "$*" ~/BIBLES/OTHER/YLT.txt;} ## YLT - Youngs Literal
function gnNT () { grep -i "$*" ~/BIBLES/OTHER/NT/NT-NAS.txt;} ## NT-NAS - New American Std
function gnOT () { grep -i "$*" ~/BIBLES/OTHER/OT/OT-NAS.txt;} ## OT-NAS - New American Std
function ge () { grep -i "$*" ~/BIBLES/OTHER/ENG.txt;} ## ge NAS-NKJV-KJV
function g17 () { grep -A 16 -i "$*" ~/BIBLES/OTHER/R17.txt;} ## g17 versions
function g24 () { grep -A 26 -B 2 -i "$*" ~/BIBLES/OTHER/24-versions.txt;} ## all 26 versions
function g27 () { grep -A 27 -B 2 -i "$*" ~/BIBLES/OTHER/27-versions.txt;} ## all 27 versions
function gt () { grep -B 1 -A 5 -i "$*" ~/BIBLES/OTHER/GETTR5.txt;} ## gt gettr CN,F,E,RUS
function gnd () { grep -A 1 -i "$*" ~/BIBLES/OTHER/ND.txt;} ## gnd NAS and German
function gnn () { grep -C 1 -i "$*" ~/BIBLES/OTHER/NN.txt;} ## gnn NAS-NKJV - lines
function edg () { grep -A 2 -B1 -i "$*" ~/BIBLES/OTHER/EDG.txt;} ## NAS,GREEK,GERMAN
function edgn () { grep -A 3 -B4 -i "$*" ~/BIBLES/OTHER/EDGN.txt;} ## NAS,GREEK,GERMAN,NKJV
function edgn-nas () { grep -A 3 -B 1 -i "$*" ~/BIBLES/OTHER/EDGN.txt| grep -A 3 -B 1 "(nas)";} ## NAS,GREEK,GERMAN,NKJV
function edgn-nk () { grep -A 3 -B 1 -i "$*" ~/BIBLES/OTHER/EDGN.txt| grep -B 5 "(nkjv)";} ## NAS,GREEK,GERMAN,NKJV
JohnMeister.com Today's Date:
|