From: Andrew Lorimer Date: Fri, 2 Aug 2019 06:56:28 +0000 (+1000) Subject: add pdf-mv.sh X-Git-Url: https://git.lorimer.id.au/scripts.git/diff_plain/064c0b794d094a455ca648bfebfd098bf64e3db2?hp=--cc add pdf-mv.sh no idea what this was for, I don't even remember writing it --- 064c0b794d094a455ca648bfebfd098bf64e3db2 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