Tiny bugfix for epub_read.sh
Hi - I was looking for a quick way to view epub files at the command line, and found this - does just what I wanted. However, I got a load of syntax errors, from bc. I tracked it down to line 237:
j=$(echo "scale=0; k=($j+1)/1-$j; scale=10; if ($j >= 0) $j+k/2 else 0" | bc)
j starts at -1, which leads to a divide by 1--1 in the expression for k. It seems bc doesn't like '--'; adding brackets around the variable j solves the problem:
j=$(echo "scale=0; k=($j+1)/1-($j); scale=10; if ($j >= 0) $j+k/2 else 0" | bc)
Thanks
|