cfg/bin/pdfsort
2016-07-21 16:29:54 +02:00

7 lines
191 B
Bash
Executable file

#!/bin/bash
for filename in *.pdf; do
target=$(echo ${filename} | sed 's/^\(\([0-9]\{4\}\)\([0-9]\{2\}\).*\)$/\2\/\3\/\1/')
mkdir -p $(dirname ${target})
mv ${filename} ${target}
done