Date: Mon, 12 Jul 2010 23:04:41 -0700 From: Steve Franks <bahamasfranks@gmail.com> To: RW <rwmaillists@googlemail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: thoughts on sorting files into sub-folders by access date? Message-ID: <AANLkTimXpWNILrwnyQOcZqwnuiFHrc-WNEyDBWbLZ3xC@mail.gmail.com> In-Reply-To: <20100702013828.3b43639c@gumby.homeunix.com> References: <AANLkTilntk8nw4bORlA-E3Wc96NwFUdjhlnqla-xcx92@mail.gmail.com> <20100701220855.70d74b03@gumby.homeunix.com> <20100702013828.3b43639c@gumby.homeunix.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <rwmaillists@googlemail.com> wrote: > On Thu, 1 Jul 2010 22:08:55 +0100 > RW <rwmaillists@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-unsubscribe@freebsd.org" >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimXpWNILrwnyQOcZqwnuiFHrc-WNEyDBWbLZ3xC>