From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 13 06:04:43 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4113D1065672 for ; Tue, 13 Jul 2010 06:04:43 +0000 (UTC) (envelope-from bahamasfranks@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id C55328FC08 for ; Tue, 13 Jul 2010 06:04:42 +0000 (UTC) Received: by iwn35 with SMTP id 35so6821963iwn.13 for ; Mon, 12 Jul 2010 23:04:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=FZOMYx4lSZqN7OEqP4kOahahhFOMX1YUCzjN4Z2mJDo=; b=lfCWnKEDjlKnk1r1pbX6DWuKkvn2QfALEQyEUZe5tZx+AZZy56bhEaeBwJBjom/T/X OyyTIEF+CZfYiB/vy1otkcb5gSWOg2nj1YW2eRI9NAu7yWwDtfIheyd+Z8QZCKrfm8Og jyNV9AlDOFV/nvnWbBIxbNg+0jy/BqoFlmY98= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=PWnlmCThdH9KSeVhl67Bim+ZKG+dP1ptlqGfl05d3EJsQnIwaXVmilc+cTY6JmGOwp qWd05JY1S0MLJVWsECH9yBrauPDYA07qPAiuNFnSLw1/YCZdomC7pBdVqMctI3vsTUwq N2LtpZkZ0NBVJEQr8L7c8mBU4iu8K2NElA5yg= MIME-Version: 1.0 Received: by 10.231.172.205 with SMTP id m13mr4791986ibz.35.1279001081639; Mon, 12 Jul 2010 23:04:41 -0700 (PDT) Received: by 10.231.143.136 with HTTP; Mon, 12 Jul 2010 23:04:41 -0700 (PDT) In-Reply-To: <20100702013828.3b43639c@gumby.homeunix.com> References: <20100701220855.70d74b03@gumby.homeunix.com> <20100702013828.3b43639c@gumby.homeunix.com> Date: Mon, 12 Jul 2010 23:04:41 -0700 Message-ID: From: Steve Franks To: RW Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-hackers@freebsd.org Subject: Re: thoughts on sorting files into sub-folders by access date? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jul 2010 06:04:43 -0000 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 wrote: > On Thu, 1 Jul 2010 22:08:55 +0100 > RW 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" >