Created
October 10, 2017 14:24
-
-
Save colobas/6da25986991309fea1a7759e00f36784 to your computer and use it in GitHub Desktop.
This file contains 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 characters
words="$(echo | k2pdfopt nickel2016.pdf -h 20000 -w 1200 -pl 100 -pr 100 | grep -Eo "[0-9]* words" | grep -Eo "[0-9]*")" | |
let "reading_time = $words * 1.1 / 275" | |
reading_mins="$(printf "%.0f" $reading_time)" | |
if [[ $reading_mins -le 60 ]]; then | |
echo "approx reading time: $reading_mins mins" | |
else | |
let "hours = $reading_mins / 60" | |
let "mins = $reading_mins % 60" | |
echo "approx reading time: $hours h $mins mins" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment