Skip to content

Instantly share code, notes, and snippets.

@mipsparc
Created August 5, 2017 03:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mipsparc/3deae64be518451ce75add3dcd0fc044 to your computer and use it in GitHub Desktop.
Save mipsparc/3deae64be518451ce75add3dcd0fc044 to your computer and use it in GitHub Desktop.
renamedirs.txtにあるディレクトリのそれぞれ1番最初にあるJPEGファイルの撮影年をディレクトリ名に付加する
#!/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