On Sun, Nov 01, 2020 at 02:15:44PM -0700, Simon Glass wrote:
> Add support for dealing with string operands, including reading a string
> from memory into an environment variable and concatenating two strings.
>
> Signed-off-by: Simon Glass
> Acked-by: Marek BehĂșn
Applied to u-boot/next,
Hi Tom,
On Fri, 6 Nov 2020 at 13:58, Tom Rini wrote:
>
> On Thu, Nov 05, 2020 at 10:27:25AM -0700, Simon Glass wrote:
> > Hi Marek,
> >
> > On Tue, 3 Nov 2020 at 09:30, Marek Behun wrote:
> > >
> > > On Tue, 3 Nov 2020 08:12:17 -0700
> > > Simon Glass wrote:
> > >
> > > > Hi Marek,
> > > >
> >
On Thu, Nov 05, 2020 at 10:27:25AM -0700, Simon Glass wrote:
> Hi Marek,
>
> On Tue, 3 Nov 2020 at 09:30, Marek Behun wrote:
> >
> > On Tue, 3 Nov 2020 08:12:17 -0700
> > Simon Glass wrote:
> >
> > > Hi Marek,
> > >
> > > On Sun, 1 Nov 2020 at 16:08, Marek Behun wrote:
> > > >
> > > > What is
> > setexpr c "*10*100"
> > >
> > > which is even simpler?
> >
> > I don't see how that works. The *10 thing in my example reads a string
> > out of address 10.
>
> Ah, got it. This requires your "[PATCH 10/10] setexpr: Add
works. The *10 thing in my example reads a string
> out of address 10.
Ah, got it. This requires your "[PATCH 10/10] setexpr: Add support
for strings" first...
But then... should there not be some '.s' size specification
somewhere?
Best regards,
Wolfgang Denk
--
DENX Software Engine
On Thu, 5 Nov 2020 10:27:28 -0700
Simon Glass wrote:
> I don't see how that works. The *10 thing in my example reads a string
> out of address 10.
/o\ ah, OK, that makes sense. So setexpr can dereference strings.
I didn't know about that, I thouth the resulting string would be
"*10*100".
Hi Marek,
On Tue, 3 Nov 2020 at 09:30, Marek Behun wrote:
>
> On Tue, 3 Nov 2020 08:12:17 -0700
> Simon Glass wrote:
>
> > Hi Marek,
> >
> > On Sun, 1 Nov 2020 at 16:08, Marek Behun wrote:
> > >
> > > What is the purpose of + operator on strings?
> > > Can't we use setenv "${a}${b}" ?
> >
> >
Hi Wolfgang,
On Thu, 5 Nov 2020 at 09:47, Wolfgang Denk wrote:
>
> Dear Simon,
>
> In message
> you
> 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
Dear Marek,
In message <20201103173011.08e22...@nic.cz> you wrote:
>
> 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} ...
No, NAK, don't.
At least not to the current imple,entation
Dear Simon,
In message
you 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
I don't get
On Tue, 3 Nov 2020 08:12:17 -0700
Simon Glass wrote:
> Hi Marek,
>
> On Sun, 1 Nov 2020 at 16:08, Marek Behun 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
>
Hi Marek,
On Sun, 1 Nov 2020 at 16:08, Marek Behun 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
Regards,
What is the purpose of + operator on strings?
Can't we use setenv "${a}${b}" ?
Add support for dealing with string operands, including reading a string
from memory into an environment variable and concatenating two strings.
Signed-off-by: Simon Glass
---
cmd/setexpr.c | 82 +++
test/cmd/setexpr.c | 86
14 matches
Mail list logo