help-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: generate date sequences


From: Colin S. Miller
Subject: Re: generate date sequences
Date: Fri, 16 Sep 2005 06:29:57 +0100
User-agent: Debian Thunderbird 1.0.2 (X11/20050602)

TBlittlefoot wrote:


<snip!>


for (( a=0 ; $a \< 10 ; a++ )) ;do date -d "5 april 2005 $a days";done


Nice little script, though, Colin. Much more efficient than
the one I worked out in my head using the days-between.sh
script in the ABS guide.

Perl or C would have been faster but thats not what the OP wanted.

Never seen a bash script that reminded me so much of C.
Didn't realize you could do that with bash.

I'm a C programmer IRL, I'm not that hot in shell scripts, but I can get by.

But I can't find a reference to "\<" in man bash. It's
not a typo, because the script works fine.

As Paul Jarc has said, it's to escape redirection. I wasn't
sure if it is needed, but it won't do any harm.

Look at man bash, paying attention to the 'for' (in SHELL GRAMMAR)
and ARITHMETIC EVALUATION sections. Searching for esac twice
is probably the best way to find the flow control constructs.

It appears to be a synonym for "<=", which also works,
but is that all it is? Would ">/" == "=>" too? I can't
think of a way to test that one off the top of my head.

My first attempt was to use -lt, ala test but it didn't work.

Tom


And this is probably the sort of converstion the OP wanted ;-}.

Colin S. Miller


--
Replace the obvious in my email address with the first three letters of the hostname to reply.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]