From: Steinar H. Gunderson Date: Fri, 12 Dec 2014 18:10:09 +0000 (+0100) Subject: Fixes for filenames with spaces. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=7d8b119649fdfe991b0f32b6d28a4cfb1af9f9ad;p=remoteglot-book Fixes for filenames with spaces. --- diff --git a/build-book.sh b/build-book.sh index 1ed0b77..38284cf 100755 --- a/build-book.sh +++ b/build-book.sh @@ -6,15 +6,15 @@ SHARDS=40 rm -f part-*.bin part-*.mtbl part-*.mtbl.part???? open.mtbl.new open.mtbl.part???? open.mtbl.part????.new 2>/dev/null -for FILE in $@; do +for FILE in "$@"; do date | tr -d "\n" echo " $FILE" - ./parallel-parse-pgn.sh $FILE + ./parallel-parse-pgn.sh "$FILE" done date for FILE in part-*.bin; do - ( ./binloader $FILE ${FILE/bin/mtbl} $SHARDS ) & + ( ./binloader "$FILE" "${FILE/bin/mtbl}" $SHARDS ) & done wait diff --git a/parallel-parse-pgn.sh b/parallel-parse-pgn.sh index 2a0279d..37ce2e4 100755 --- a/parallel-parse-pgn.sh +++ b/parallel-parse-pgn.sh @@ -1,6 +1,6 @@ #! /bin/sh FILE=$1 for X in $( seq 0 39 ); do - ( ./partition-pgn.sh $FILE $X 40 | ~/nmu/pgn-extract/pgn-extract -e -Wsessebin >> part-$X.bin 2>/dev/null ) & + ( ./partition-pgn.sh "$FILE" $X 40 | ~/nmu/pgn-extract/pgn-extract -e -Wsessebin >> part-$X.bin 2>/dev/null ) & done wait diff --git a/partition-pgn.sh b/partition-pgn.sh index 1c73ca4..18a2020 100755 --- a/partition-pgn.sh +++ b/partition-pgn.sh @@ -1,10 +1,10 @@ #! /bin/sh -FILE=$1 +FILE="$1" P=$2 NUM=$3 split_point() { - FILE=$1 + FILE="$1" P=$2 NUM=$3 SIZE=$( stat -c %s "$FILE" )