Last active
December 17, 2015 07:39
-
-
Save lionelyoung/5574120 to your computer and use it in GitHub Desktop.
Fix the creation and modified date for video files from Galaxy Note 2
This file contains 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
#!/usr/bin/env bash | |
cd ../src || exit 1 | |
for f in 20*_*.*; do | |
TIMESTAMP=${f%.*} # Remove extension | |
TIMESTAMP=`echo $TIMESTAMP | sed 's/_001$//'` # Remove _001 from *.3gp files | |
TIMESTAMP=`echo $TIMESTAMP | awk 'sub("..$", "")'` # Remove last two characters (seconds in the timestamp) | |
TIMESTAMP=`echo $TIMESTAMP | sed 's/_//'` | |
echo Setting $f to $TIMESTAMP | |
touch -mt $TIMESTAMP $f | |
touch -t $TIMESTAMP $f | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment