From 064c0b794d094a455ca648bfebfd098bf64e3db2 Mon Sep 17 00:00:00 2001 From: Andrew Lorimer Date: Fri, 2 Aug 2019 16:56:28 +1000 Subject: [PATCH] add pdf-mv.sh no idea what this was for, I don't even remember writing it --- pdf-mv.sh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100755 pdf-mv.sh 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 -- 2.43.2