In need of a bit of shellish magic
Michael ODonnell
michael.odonnell at comcast.net
Fri Jun 2 17:27:01 EDT 2006
>> % 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.
I never type it; it's enshrined in my scripts and functions.
> 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... ;->
More information about the gnhlug-discuss
mailing list