[PATCH 10/10] setexpr: Add support for strings

Simon Glass
2020-11-05T17:27:25Z

Hi Marek,

On Tue, 3 Nov 2020 at 09:30, Marek Behun <marek.behun@nic.cz> wrote:
>
> On Tue, 3 Nov 2020 08:12:17 -0700
> Simon Glass <sjg@chromium.org> wrote:
>
> > Hi Marek,
> >
> > On Sun, 1 Nov 2020 at 16:08, Marek Behun <marek.behun@nic.cz> wrote:
> > >
> > > What is the purpose of + operator on strings?
> > > Can't we use setenv "${a}${b}" ?
> >
> > Yes, that does the same thing, although it is a bit clumsy.
> >
> > setenv a *10
> > setenv b *100
> > setenv c "${a}${b}"
> >
> > instead of
> >
> > setexpr c *10 + *100
>
> Hi Simon,
>
> I don't know. It provides the same functionality that exists, but only
> adds code.
> Is someone really going to use this?

I don't know. Perhaps we can wait and see if anyone cares?

>
> Marek
>
> PS: What I think would be more useful is to add substringing
> functionality into hush, so e.g. ${a:3:5}, and pattern substitions:
> ${parameter/pattern/string} ...

Yes we need to upgrade hush.

Regards,
Simon