User Tools

Site Tools


chmerge.sh

#!/bin/bash

# this one works far better than prior chaptermerge. # # after it's done, rsync the files across with something like: # rsync –exclude '*pdf' –progress –archive – recursive –relative # –checksum –verbose –compress -e “ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null” # /mnt/c/Users/jerodt/Documents/2020_ndac_q1/[1-9]* # u44402384@home317720934.1and1-data.host:/kunden/homepages/41/d317720934/htdocs/clickandbuilds/dokuWiki/NDAC/data/pages/

BASE=/kunden/homepages/41/d317720934/htdocs/tmp/ndac-2021-03-10

for i in `find ./[0-9]* -type d -name '*-*-*' -print` ; do

echo $i
CHAPTER=`echo ${i}|cut -d '/' -f 4`
echo chapter = $CHAPTER
cd $BASE/$i 
echo "in directory:"
pwd
echo "creating ${CHAPTER}.txt" 
echo "====== Chapter ${CHAPTER} ======" > ${CHAPTER}.txt 
cat ${CHAPTER}-*.txt >> ${CHAPTER}.txt;

done

chmerge.sh.txt · Last modified: 2022/03/04 10:31 (external edit)