1 2 3 4 5 6 7 8 9 10 11
#!/bin/sh cat book-list | while read buch do i=1 while [ -e "chapters/$buch/$i" ] do echo "chapters/$buch/$i" i=$((i+1)) done done