In need of a bit of shellish magic

Tom Buskey tom at buskey.name
Fri Jun 2 17:50:01 EDT 2006


On 6/2/06, Ben Scott <dragonhawk at gmail.com> wrote:
>
> On 6/2/06, Michael ODonnell <michael.odonnell at comcast.net> wrote:
> >  % timeStamp="`date '+%Y%m%d%H%M%S'`"
>
>   FYI, "date -I" is much easier to type.  Make it "date -Is" if you
> need it down to the seconds.
>
>   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.



Well, we are talking Linux and that implies GNU date.  So date -I works.

date +%Y-%m-%d works on GNU, xBSD, Solaris, Irix, probably most.  I go for
portability in my scripts.

Didn't we find an issue with Debian vs Red Hat using different utilities w/
the same name?  Debian was perl based and Red Hat was a binary from C?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.gnhlug.org/mailman/private/gnhlug-discuss/attachments/20060602/5fc8be3f/attachment.html


More information about the gnhlug-discuss mailing list