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
David JULIEN 28dfdd5ae5 feat: change shebang to /usr/bin/env sh
this setting is more user-config compliant
2021-02-12 23:20:57 +01:00

35 lines
898 B
Bash
Executable File

#!/usr/bin/env sh
######################################################################
# @author : swytch
# @file : mommerge
# @license : MIT
# @created : Wednesday May 20, 2020 18:20:23 CEST
#
# @description : merge mom files from current dir
# compile it with `compiler` script
# @dependencies : `compiler` script
######################################################################
# 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
list=$(ls *.mom)
touch rendu.mom
for doc in "$list"; do
cat "$doc" >> rendu.mom
printf "\n.COLLATE" >> rendu.mom
done
# Remove the last ".COLLATE"
sed -i '$ d' rendu.mom
# Compile it
compiler rendu.mom