diff --git a/aliases/functions b/aliases/functions index 5fe4eaa..06d23b7 100644 --- a/aliases/functions +++ b/aliases/functions @@ -201,9 +201,11 @@ suffix() { alias exifcopy="exiftool -tagsFromFile" photobydate() { for i in ${*:-(#i)*.(JPG|CR2)}; do + if [[ -e $i ]]; then dir=$(exiftool -p '$DateTimeOriginal' $i | tr ':' '-' | cut -d' ' -f1;) mkdir -p $dir mv ${i:r}.* $dir + fi done }