This repository has been archived on 2023-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/.local/bin/mommerge

34 lines
858 B
Plaintext
Raw Normal View History

#!/usr/bin/env sh
######################################################################
2021-02-14 19:07:45 +01:00
# @author : swytch
# @file : mommerge
# @license : GPLv3
2021-02-14 19:07:45 +01:00
# @created : Wednesday May 20, 2020 18:20:23 CEST
#
2021-02-14 19:07:45 +01:00
# @description : merge mom files from current dir
# compile it with `compiler` script
######################################################################
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
[ -e rendu.mom ] && rm rendu.mom
2020-05-06 03:20:19 +02:00
list=$(ls *.mom)
2020-05-06 03:20:19 +02:00
touch rendu.mom
for doc in "$list"; do
2020-05-06 03:20:19 +02:00
cat "$doc" >> rendu.mom
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