Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- function reculatexdiff
- {
- if [[ $# -ne 3 ]];
- then
- echo "Usage:"
- echo " mylatexdiff <folder1> <folder2> <folder3>"
- return
- fi
- if [ ! -d "$1" ];
- then
- echo "Directory $1 does not exists!"
- return
- fi
- if [ ! -d "$2" ];
- then
- echo "Directory $2 does not exists!"
- return
- fi
- echo "Removing $3..."
- rm -rf $3
- echo "Copying $1 in $3..."
- cp -rf $1 $3
- # [BASH] Uncomment to make sure globstar is enabled.
- # shopt -s globstar
- for file1 in $1/**/*.tex;
- do
- file1abs=$(echo $file1 | cut -d'/' -f2-)
- for file2 in $2/**/*.tex;
- do
- file2abs=$(echo $file2 | cut -d'/' -f2-)
- if [[ $file1abs == $file2abs ]];
- then
- echo "Generating difference for $file1abs..."
- latexdiff $file1 $file2 > $3/$file1abs
- fi
- done
- done
- }
Add Comment
Please, Sign In to add comment