Last active
January 7, 2022 11:05
-
-
Save 9oelM/ce9eab16caba1a19472be94464dbfdf7 to your computer and use it in GitHub Desktop.
Revisions
-
9oelM revised this gist
Jan 7, 2022 . 1 changed file with 78 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,18 +3,96 @@ set -e # exit on first error TRANSLATION="kjv" all_books=" 'GEN' => 'Genesis', 'EXO' => 'Exodus', 'LEV' => 'Leviticus', 'NUM' => 'Numbers', 'DEU' => 'Deuteronomy', 'JOS' => 'Joshua', 'JDG' => 'Judges', 'RUT' => 'Ruth', '1SA' => '1 Samuel', '2SA' => '2 Samuel', '1KI' => '1 Kings', '2KI' => '2 Kings', '1CH' => '1 Chronicles', '2CH' => '2 Chronicles', 'EZR' => 'Ezra', 'NEH' => 'Nehemiah', 'EST' => 'Esther', 'JOB' => 'Job', 'PSA' => 'Psalms', 'PRO' => 'Proverbs', 'ECC' => 'Ecclesiastes', 'SNG' => 'Song of Songs', 'ISA' => 'Isaiah', 'JER' => 'Jeremiah', 'LAM' => 'Lamentations', 'EZK' => 'Ezekiel', 'DAN' => 'Daniel', 'HOS' => 'Hosea', 'JOL' => 'Joel', 'AMO' => 'Amos', 'OBA' => 'Obadiah', 'JON' => 'Jonah', 'MIC' => 'Micah', 'NAM' => 'Nahum', 'HAB' => 'Habakkuk', 'ZEP' => 'Zephaniah', 'HAG' => 'Haggai', 'ZEC' => 'Zechariah', 'MAL' => 'Malachi', 'MAT' => 'Matthew', 'MRK' => 'Mark', 'LUK' => 'Luke', 'JHN' => 'John', 'ACT' => 'Acts', 'ROM' => 'Romans', '1CO' => '1 Corinthians', '2CO' => '2 Corinthians', 'GAL' => 'Galatians', 'EPH' => 'Ephesians', 'PHP' => 'Philippians', 'COL' => 'Colossians', '1TH' => '1 Thessalonians', '2TH' => '2 Thessalonians', '1TI' => '1 Timothy', '2TI' => '2 Timothy', 'TIT' => 'Titus', 'PHM' => 'Philemon', 'HEB' => 'Hebrews', 'JAS' => 'James', '1PE' => '1 Peter', '2PE' => '2 Peter', '1JN' => '1 John', '2JN' => '2 John', '3JN' => '3 John', 'JUD' => 'Jude', 'REV' => 'Revelation', " usage=" verses.sh -b [required] book name -r [required] range -t [optional] translation (default: kjv) or list [optional] list all books and their abbreviations for the use in -b option examples: 1) verses.sh -b john -r 1:29 -t kjv 2) verses.sh -b matthew -r 1:1-20 -t kjv 3) verses.sh list " FIRST_ARG="$1" [ "${FIRST_ARG}" == "list" ] && printf "${all_books}" && exit while getopts b:r:t:h: flag; do case "${flag}" in t) -
9oelM revised this gist
Jan 4, 2022 . No changes.There are no files selected for viewing
-
9oelM revised this gist
Jan 4, 2022 . No changes.There are no files selected for viewing
-
9oelM revised this gist
Jan 4, 2022 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -49,8 +49,6 @@ chapter_numbers=$(echo "${bible_api_result}" | jq -r '.verses[].chapter') verse_numbers=$(echo "${bible_api_result}"| jq -r '.verses[].verse') verse_texts=$(echo "${bible_api_result}"| jq -r '.verses[].text') chapter_and_verses=$(paste -d ":" <(echo "${chapter_numbers}") <(echo "${verse_numbers}")) paste -d " " <(echo "${chapter_and_verses}") <(echo "${verse_texts}" | awk NF) -
9oelM revised this gist
Jan 4, 2022 . 1 changed file with 13 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,11 +6,11 @@ TRANSLATION="kjv" usage=" verses.sh -b [required] book name -r [required] range -t [optional] translation (default: kjv) examples: 1) verses.sh -b john -r 1:29 -t kjv 2) verses.sh -b matthew -r 1:1-20 -t kjv " @@ -30,15 +30,15 @@ while getopts b:r:t:h: flag; do printf "${usage}" exit ;; *) printf "${usage}" exit ;; esac done if [ -z "${BOOK}" ] || [ -z "${RANGE}" ]; then echo "[!] -b and -r options are required. Check again." printf "${usage}" exit 1 fi @@ -49,6 +49,9 @@ chapter_numbers=$(echo "${bible_api_result}" | jq -r '.verses[].chapter') verse_numbers=$(echo "${bible_api_result}"| jq -r '.verses[].verse') verse_texts=$(echo "${bible_api_result}"| jq -r '.verses[].text') echo "${chapter_numbers}" echo "${verse_numbers}" chapter_and_verses=$(paste -d ":" <(echo "${chapter_numbers}") <(echo "${verse_numbers}")) paste -d " " <(echo "${chapter_and_verses}") <(echo "${verse_texts}" | awk NF) -
9oelM created this gist
Jan 4, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,54 @@ #!/bin/bash set -e # exit on first error TRANSLATION="kjv" usage=" verses.sh -b [required] book name -r [required] range -t [optional] translation (default: kjv) examples: 1) verses.sh -b john -r 1:29 -t kjv 2) verses.sh -b matthew -r 1:1-20 -t kjv " while getopts b:r:t:h: flag; do case "${flag}" in t) TRANSLATION=${OPTARG} ;; r) RANGE=${OPTARG} ;; b) BOOK=${OPTARG} ;; h) printf "${usage}" exit ;; *) printf "${usage}" exit ;; esac done if [ -z "${BOOK}" ] || [ -z "${RANGE}" ] || [ -z "${TRANSLATION}" ]; then echo "[!] All parameters are required. Check again." printf "${usage}" exit 1 fi bible_api_result=$(curl --connect-timeout 10 --max-time 10 -s "https://bible-api.com/${BOOK}+${RANGE}") chapter_numbers=$(echo "${bible_api_result}" | jq -r '.verses[].chapter') verse_numbers=$(echo "${bible_api_result}"| jq -r '.verses[].verse') verse_texts=$(echo "${bible_api_result}"| jq -r '.verses[].text') chapter_and_verses=$(paste -s -d ":" <(echo "${chapter_numbers}") <(echo "${verse_numbers}")) paste -s -d " " <(echo "${chapter_and_verses}") <(echo "${verse_texts}")