2021-02-12 23:20:57 +01:00
|
|
|
#!/usr/bin/env sh
|
2020-05-20 18:34:34 +02:00
|
|
|
|
|
|
|
######################################################################
|
2021-02-14 19:07:45 +01:00
|
|
|
# @author : swytch
|
|
|
|
# @file : mommerge
|
2021-02-15 00:37:34 +01:00
|
|
|
# @license : GPLv3
|
2021-02-14 19:07:45 +01:00
|
|
|
# @created : Wednesday May 20, 2020 18:20:23 CEST
|
2020-05-20 18:34:34 +02:00
|
|
|
#
|
2021-02-14 19:07:45 +01:00
|
|
|
# @description : merge mom files from current dir
|
|
|
|
# compile it with `compiler` script
|
2020-05-20 18:34:34 +02:00
|
|
|
######################################################################
|
|
|
|
|
|
|
|
|
2020-05-06 03:20:19 +02:00
|
|
|
# Gather the mom files from current dir and compile them into ONE pdf file, using my compiler script
|
|
|
|
# /!\ files must be names 0_file0, 1_file1... in order to be processed correctly
|
|
|
|
|
|
|
|
# if the file already exists, delete it
|
2020-05-20 17:03:00 +02:00
|
|
|
[ -e rendu.mom ] && rm rendu.mom
|
2020-05-06 03:20:19 +02:00
|
|
|
|
2020-05-20 17:03:00 +02:00
|
|
|
list=$(ls *.mom)
|
2020-05-06 03:20:19 +02:00
|
|
|
|
|
|
|
touch rendu.mom
|
|
|
|
|
2020-05-20 17:03:00 +02:00
|
|
|
for doc in "$list"; do
|
2020-05-06 03:20:19 +02:00
|
|
|
cat "$doc" >> rendu.mom
|
2020-05-25 15:04:16 +02:00
|
|
|
printf "\n.COLLATE" >> rendu.mom
|
2020-05-06 03:20:19 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
# Remove the last ".COLLATE"
|
|
|
|
sed -i '$ d' rendu.mom
|
|
|
|
|
|
|
|
# Compile it
|
|
|
|
compiler rendu.mom
|