|
|
@ -4,13 +4,18 @@ |
|
|
|
#Description: Generate an sb file containing all the songs that are not |
|
|
|
# already in volume-1 and volume-2 |
|
|
|
|
|
|
|
GREP="$GREP_OPTIONS" |
|
|
|
export GREP_OPTIONS="" |
|
|
|
|
|
|
|
BOOKS_DIR="books" |
|
|
|
|
|
|
|
#all songs |
|
|
|
cd songs |
|
|
|
ls -1 */*.sg > ../res1 |
|
|
|
cd .. |
|
|
|
|
|
|
|
#get volume 1 list |
|
|
|
tail -n +13 volume-1.sb > tmp1 |
|
|
|
tail -n +13 "$BOOKS_DIR/volume-1.sb" > tmp1 |
|
|
|
head -n -2 tmp1 > list1 |
|
|
|
sed -i -e "s/\",//g" -e "s/ \"//g" -e "s/\"//g" list1 |
|
|
|
|
|
|
@ -18,7 +23,7 @@ sed -i -e "s/\",//g" -e "s/ \"//g" -e "s/\"//g" list1 |
|
|
|
grep -vf list1 res1 > res2 |
|
|
|
|
|
|
|
#get volume 2 list |
|
|
|
tail -n +14 volume-2.sb > tmp2 |
|
|
|
tail -n +14 "$BOOKS_DIR/volume-2.sb" > tmp2 |
|
|
|
head -n -2 tmp2 > list2 |
|
|
|
sed -i -e "s/\",//g" -e "s/ \"//g" -e "s/\"//g" list2 |
|
|
|
|
|
|
@ -31,10 +36,12 @@ head -c -2 res3 > res |
|
|
|
|
|
|
|
|
|
|
|
#make volume 3 sb file |
|
|
|
cat utils/header-volume-3 > volume-3.sb |
|
|
|
cat res >> volume-3.sb |
|
|
|
echo "]" >> volume-3.sb |
|
|
|
echo "}" >> volume-3.sb |
|
|
|
cat utils/header-volume-3 > "$BOOKS_DIR/volume-3.sb" |
|
|
|
cat res >> "$BOOKS_DIR/volume-3.sb" |
|
|
|
echo "]" >> "$BOOKS_DIR/volume-3.sb" |
|
|
|
echo "}" >> "$BOOKS_DIR/volume-3.sb" |
|
|
|
|
|
|
|
#remove tmp files |
|
|
|
rm -f res res1 res2 res3 list1 list2 tmp1 tmp2 |
|
|
|
|
|
|
|
export GREP_OPTIONS="$GREP" |
|
|
|