TMF/prev
2026-04-15 17:08:02 +01:00

13 lines
354 B
Bash
Executable file

#!/bin/bash
set -e
OldDir="$(pwd)"
cd "$(dirname "$0")"
if ! [ -e bookmark.txt ]; then
echo "Please run $(dirname "$0")/init first to initialise the book"
exit 1; fi
N=$[ "$(cat bookmark.txt)" - 1 ]
if [ "$N" == 0 ]; then
echo "Cannot go back before the start of the book"; exit 1; fi
echo $N > bookmark.txt
cd "$OldDir"
$(dirname "$0")/read