Created
August 5, 2017 03:59
-
-
Save mipsparc/3deae64be518451ce75add3dcd0fc044 to your computer and use it in GitHub Desktop.
renamedirs.txtにあるディレクトリのそれぞれ1番最初にあるJPEGファイルの撮影年をディレクトリ名に付加する
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
#!/bin/bash | |
cat renamedirs.txt | while read DIRN | |
do | |
FILENAME=`ls -1 $DIRN | sed -n '1p'` | |
YEAR=`echo ${DIRN}/${FILENAME} | python3 photodir_year.py` | |
echo "renaming ${DIRN}" | |
mv $DIRN ${DIRN}_${YEAR} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment