Created
August 31, 2012 16:17
-
-
Save csu/3555291 to your computer and use it in GitHub Desktop.
Copy creation dates of files from a mirror directory
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
# Part of the txt-to-dayone repository: https://github.com/christophersu/txt-to-dayone | |
IFS=$'\n' | |
files=$(ls | egrep '(.txt)') | |
for i in $files; do | |
#get original creation dates | |
original=$( GetFileInfo -d "$i" ) | |
#change the creation date of the same file in the destination | |
if [ -e "/Users/christophersu/Desktop/test/$i" ]; then | |
SetFile -d "$original" "/Users/christophersu/Desktop/test/$i" | |
fi | |
done | |
unset IFS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment