]> zdv2.bktei.com Git - BK-2020-03.git/commitdiff
chore(user/randtxt.sh):Update description and add glob var comments
authorSteven Baltakatei Sandoval <baltakatei@gmail.com>
Tue, 21 Oct 2025 03:49:28 +0000 (03:49 +0000)
committerSteven Baltakatei Sandoval <baltakatei@gmail.com>
Tue, 21 Oct 2025 03:49:28 +0000 (03:49 +0000)
user/randtxt.sh

index cd242a2d6c984d62246449bc541eb3c48604a9b2..642b4e0294767fc23772ca0dcfb6b89b51acdb06 100755 (executable)
@@ -1,12 +1,12 @@
 #!/bin/bash
 #!/bin/bash
-# Desc: Outputs text at randomish position within dir of text files
+# Desc: Output random text selection from a text file within a directory
 # Usage: randtxt.sh DIR
 # Usage: randtxt.sh DIR
-# Version 0.0.4
+# Version 0.0.5
 # Depends: Bash 5.1.16, GNU findutils 4.8.0, GNU Coreutils 8.32
 # Example: randtxt.sh ~/Calibre\ Library/
 
 # Depends: Bash 5.1.16, GNU findutils 4.8.0, GNU Coreutils 8.32
 # Example: randtxt.sh ~/Calibre\ Library/
 
-SAMPLE=10000;
-CONTEXT="5000"; # total bytes +1 before and after point within file to print
+SAMPLE=10000;   # ceiling for number of text files to consider
+CONTEXT="5000"; # total bytes +1 of text to display
 if [[ $(( CONTEXT/2 + CONTEXT/2 )) -lt $CONTEXT ]]; then ((CONTEXT++)); fi;
 
 
 if [[ $(( CONTEXT/2 + CONTEXT/2 )) -lt $CONTEXT ]]; then ((CONTEXT++)); fi;