]> zdv2.bktei.com Git - BK-2020-03.git/blobdiff - user/randtxt.sh
feat(user/randtxt.sh):Move status message to stderr
[BK-2020-03.git] / user / randtxt.sh
index 642b4e0294767fc23772ca0dcfb6b89b51acdb06..a6879aaafa2c291443b022013c96cdf37f758d88 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # Desc: Output random text selection from a text file within a directory
 # Usage: randtxt.sh DIR
-# Version 0.0.5
+# Version 0.0.6
 # Depends: Bash 5.1.16, GNU findutils 4.8.0, GNU Coreutils 8.32
 # Example: randtxt.sh ~/Calibre\ Library/
 
@@ -79,7 +79,7 @@ getRandText() {
             selCount="$(( selEnd - selStart + 1 ))";  # number of bytes within selection
             # Output context
             file="$(cut -f2- <<< "${fileSizeList[i]}"; )";
-            printf "INFO:Sample of:%s\n" "$file";
+            printf "INFO:Sample of:%s\n" "$file" 1>&2;
             tail --bytes=+$((selStart+1)) -- "$file" | head --bytes=$((selCount));
             printf "\n";
             return 0;