Last active
October 30, 2017 23:53
-
-
Save sillage/e50635f2b85d9f7702b0b281206fb8d3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# source: https://superuser.com/a/764524 | |
# Managed formats: | |
# <xmp:CreateDate>2017-07-19T08:53:29Z</xmp:CreateDate> | |
# <xmp:CreateDate>2017-10-16T12:07:43+02:00</xmp:CreateDate> | |
# xmp:CreateDate="2013-09-03T17:37:08+02:00" | |
for f in *.pdf | |
do | |
touch -t $(strings "$f" | grep 'xmp:CreateDate' | tail -1 | sed 's_.*xmp:CreateDate.\{1,2\}\(....\)-\(..\)-\(..\)T\(..\):\(..\):\(..\).*_\1\2\3\4\5.\6_g') "$f" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment