Created
December 17, 2012 15:24
-
-
Save geta6/4319091 to your computer and use it in GitHub Desktop.
mtimeをfixします
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/zsh | |
if [ -z $1 ]; then | |
echo 'Usage: mtimefix [dirname:/dir/name/here]' | |
exit 1 | |
fi | |
if [ -d $1 ]; then | |
for DIR in $1/* | |
do | |
if [ -d $DIR ]; then | |
FILE=/`find $DIR -type f -print0 | xargs -0 ls -l --time-style=long-iso | sort -k 6,7 | tail -1 | cut -d'/' -f2-` | |
#echo $FILE | |
touch -r $FILE $DIR | |
fi | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment