cfg/bin/pdfsort

8 lines
191 B
Text
Raw Permalink Normal View History

2016-07-21 13:48:49 +00:00
#!/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