quran

English translation of the Quran from the command line
git clone https://riazj.com/git/quran
Log | Files | Refs | README | LICENSE

commit 760c69e4fb8c6675b678bbb7e6f1fd51287f6128
parent 56327a7afc722a18a119997929c1dd44f493ee02
Author: Riaz <riaz@riazj.com>
Date:   Thu, 26 Jun 2025 19:18:30 -0700

Add info about errors occuring when the pager closes

Diffstat:
MREADME | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/README b/README @@ -36,7 +36,7 @@ The following is a summary of the improvements made: - Added portability with BSD grep by simplifying the search patterns - Decreased the number of lines in quran.txt from ~7140 to ~6700 by removing unnecessary blank lines and splitting the list of surahs into a separate file -- Decreased the number of SLOC from ~130 to ~80 +- Decreased the number of SLOC from ~130 to ~70 - Increased performance by removing unnecessary cut, sed, and xargs commands - Improved readability by dividing the code into functions - For flexibility with text operations, the output is in standard output @@ -54,7 +54,14 @@ or a script like this: /usr/local/bin/quran "$@" | fold -s | "${PAGER:-less}" -Note: Use less with -R so that if grep returns an output with color, it can be viewed. +Use less with -R so that if grep returns an output with color, it can be +viewed. The examples above can result in the script returning an error when the +pager is closed (exit code 141) before the entire range of surahs or ayat have +been found. To avoid this, the output can be redirected to a file that the +pager opens. However, the pager will take more time to open since the file must +be written first. + + /usr/local/bin/quran "$@" | fold -s > tmpfile; "${PAGER:-less}" tmpfile Adding Other Translations