In need of a bit of shellish magic

James R. Van Zandt jrvz at comcast.net
Fri Jun 2 22:30:01 EDT 2006


"Michael ODonnell" <michael.odonnell at comcast.net> wrote:
>   >  The "-I" switch is short for ISO-8601, which apparently specifies
>   >dates as "all numeric, most significant component first".  Which is
>   >handy, because then the files sort properly in directory listings.
>
>   Yup, I have a lot of scripty stuff that depends on exactly such
>   sortability - very handy.  I'd not heard of that -I switch before
>   and it seemed promising, but it turns out that the dashes in the
>   resultant strings render them useless for most of my purposes.
>   And I wonder why that switch isn't mentioned (at least on my
>   Debian unstable machines) in the man pages or in the output to
>   the --help switch?  It's apparently a secret...  ;->

I submitted the patches to get the -I switch into date in the first
place - including man page and help text updates.  But now they're
gone - not even in the info pages.  The -I switch is still in the
source code, but marked "deprecated".

This is (was) Debian Bug#354799, discussed here:
http://groups.google.com/group/linux.debian.bugs.dist/browse_thread/thread/248e13e6ee940d3d/16f1d0c8dd1e0e4f?lnk=st&q=date+gnu+%22iso+8601%22+%22-i%22+deprecated&rnum=1#16f1d0c8dd1e0e4f

Apparently there was some difficulty parsing ISO 8601 dates, so they
decided to switch to RFC 3339 instead.  Even though all the problems
seems to relate to the time part rather than the date.

I guess we are expected to use "date --rfc-3339=date"
now.  Or, I suppose, "date +%F".  Disappointing.

             - Jim Van Zandt




More information about the gnhlug-discuss mailing list