From owner-freebsd-questions Sat Oct 13 3: 0:52 2001 Delivered-To: freebsd-questions@freebsd.org Received: from swan.mail.pas.earthlink.net (swan.mail.pas.earthlink.net [207.217.120.123]) by hub.freebsd.org (Postfix) with ESMTP id 23D4F37B406 for ; Sat, 13 Oct 2001 03:00:50 -0700 (PDT) Received: from blossom.cjclark.org (dialup-209.245.143.238.Dial1.SanJose1.Level3.net [209.245.143.238]) by swan.mail.pas.earthlink.net (EL-8_9_3_3/8.9.3) with ESMTP id DAA26960; Sat, 13 Oct 2001 03:00:47 -0700 (PDT) Received: (from cjc@localhost) by blossom.cjclark.org (8.11.6/8.11.3) id f9DA0NQ08266; Sat, 13 Oct 2001 03:00:23 -0700 (PDT) (envelope-from cjc) Date: Sat, 13 Oct 2001 03:00:23 -0700 From: "Crist J. Clark" To: Randy Bush Cc: Mike Meyer , questions@FreeBSD.ORG Subject: Re: date of a file Message-ID: <20011013030023.M6274@blossom.cjclark.org> Reply-To: cjclark@alum.mit.edu References: <73720831@toto.iv> <15303.43126.44123.116068@guru.mired.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from randy@psg.com on Sat, Oct 13, 2001 at 12:23:59AM -0700 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Oct 13, 2001 at 12:23:59AM -0700, Randy Bush wrote: > > date +%y%m%d-%H%M%S -jf "%b %d %H:%M:%S" `ls -lT filename | awk ' { print $6, $7, $8, $9 } '` > > i have tried many variations on this, and all fail as follows: > > rip.psg.com:/usr/home/randy> date -j +%y%m%d-%H%M%S -f '%b %d %T %Y' `ls -lT 2borg | awk '{print $6, $7, $8, $9}'` > date: illegal time format > usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... > [-f fmt date | [[[[[cc]yy]mm]dd]HH]MM[.ss]] [+format] > > yes, this all seems in accord with what 'man strftime' shows me. It has to do with how date(1) reads the command line. Basically, the '+ format' and '-f format date' options are not compatible. This appears to be a bug, but it would be really tricky to fix. (Hmm... maybe not...) Send in a PR if you would like so it gets into the system. Have a look at date.c. It is pretty clear what is happening. Feel free to submit a fix with a PR. -- Crist J. Clark | cjclark@alum.mit.edu | cjclark@jhu.edu http://people.freebsd.org/~cjc/ | cjc@freebsd.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message