RW,

Thanks!  For posterity, this is the full script that works for me for
sorting my photos by date:

#!/bin/sh
for file in *.jpg *.jpeg *.JPG *.JPEG *.avi *.AVI
do
        dir="${targetdir}`stat -f %Sm -t %Y.%m.%d ${file}`"
        [ -d "${dir}" ] || mkdir "${dir}"
        mv "${file}" "${dir}"
done

Best,
Steve


On Thu, Jul 1, 2010 at 5:38 PM, RW <rwmailli...@googlemail.com> wrote:
> On Thu, 1 Jul 2010 22:08:55 +0100
> RW <rwmailli...@googlemail.com> wrote:
>
>
>> dir="${targetdir}/`stat -f %Sm -t %Y%m%d ${file}`/"
>> [ -d "${dir}"] || mkdir "${dir}"
>> mv "${file}" "${dir}"]
>>
>
> Should be:
>
> dir="${targetdir}/`stat -f %Sm -t %Y%m%d ${file}`/"
> [ -d "${dir}" ] || mkdir "${dir}"
> mv "${file}" "${dir}"
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"
>
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"

Reply via email to