Andre Poenitz wrote:
Colin S. Miller <[EMAIL PROTECTED]> wrote:
for (( a=0 ; $a \< 10 ; a++ )) ;do date -d "5 april 2005 $a days";done
Tue Apr 5 00:00:00 BST 2005
[...]
Nice trick, that '$a days' thing.
The preamble could have been a bit shorter, though:
seq 10 | while read a; do date -d "5 april 2005 $a days"; done
Regards,
Andre'
Andre,
Thank you; I was not aware of the seq command.
However,
it is not necessary to use 'read' when xargs will do the same, giving
seq 0 10 | xargs -i date -5 "5 april 2005 {} days"
Is there a shorter form?
As I said before, I'm not sure if this is offically supported by GNU date.
What I suspect is happening is that '-d "4 days" ' adds 4 days to date's
current time, which I previously set to 5 april.
Colin S. Miller
--
Replace the obvious in my email address with the first three letters of the
hostname to reply.
_______________________________________________
help-gnu-utils mailing list
help-gnu-utils@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-utils