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

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

Re: generate date sequences


From: TBlittlefoot
Subject: Re: generate date sequences
Date: Fri, 16 Sep 2005 00:10:49 -0700
User-agent: Mutt/1.3.24i

On Fri, Sep 16, 2005 at 06:29:57AM +0100, Colin S. Miller wrote:
> 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 afraid to learn C, though I have K&R. There are so many apps
that I'd love to modify that I don't think I'd get anything else
done.

At the top of the list would be making Screen create graphical
ptys capable of rendering static graphics with the framebuffer,
so that I could run a basic graphical web browser in a Screen
pty. Then I could ditch X, which I only use for my graphical
browser.

Yes, I know about the svgalib-dependent versions of Links and
W3m, but svgalib is the only software I've ever used that crashes
my box, and it does it fairly often. The maintainer is busy with
other things...It also takes over the entire tty.

> I'm not that hot in shell scripts, but I can get by.

Indeed.

> 
> >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.

Okay.

> 
> >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.

Those are conditional expressions for the test ([) builtin,
and the [[ compound command. Apparently they are much less
arithmetical that the other.

> 
> >Tom
> >
> 
> And this is probably the sort of conversation the OP wanted ;-}.

<another shrug> He probably really wants to learn shell scripting,
but is shy and boggled by the complexity of it. I can relate to
the latter.

But he really does need to learn some manners and to follow
through, experimenting and reading and asking questions based on
that work, rather than laziness.

Thanks, Colin,

Tom






reply via email to

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