From: Andrew Lorimer Date: Tue, 19 Nov 2019 06:12:40 +0000 (+1100) Subject: Merge branch 'master' of charles:/tank/andrew/code/scripts X-Git-Url: https://git.lorimer.id.au/scripts.git/diff_plain/6c15104e95fb712a90e96280be764d39c671a23a?hp=d220e3360de621b6b6a699de6ddc10e6cac29cca Merge branch 'master' of charles:/tank/andrew/code/scripts --- diff --git a/pdf-mv.sh b/pdf-mv.sh new file mode 100755 index 0000000..a552fe3 --- /dev/null +++ b/pdf-mv.sh @@ -0,0 +1,6 @@ +#! /bin/bash + +for oldfile in "$@"; do + newname=$(pdfinfo -meta $oldfile | sed -n '/MT-.../p' | sed -n 's/.*\(MT-...\): \(.*\)<.*/\L\1-\2\.pdf/; s/ /-/gp') + mv $oldfile $newname +done