Skip to contentSkip to conversation

setexpr syntax

U-Boot Frans Meulenbroeks 2 participants 2 messages Feb 25, 2010

lore
Share & tools
lore
#0 lore raw

Dear all,

I noticed setexpr help says:
<op> can be &, |, ^, +, -, *, /, %

However, when one uses the hush shell additional escapes might be needed.

=> setexpr tst 3 & f
syntax error
=> setexpr tst 3 | f
syntax error

This works:
=> setexpr tst 3 \| f
=> print tst
tst=f

Not sure whether we should document this somewhere (or modify the help text). It took me a few minutes to realise what is going on, so a warning somewhere seems in place.

#1 lore raw

Dear Frans Meulenbroeks,

Quoted 5 lines · In message <[email protected]> you…

I noticed setexpr help says:
<op> can be &, |, ^, +, -, *, /, %

However, when one uses the hush shell additional escapes might be needed.

Well, yes, of course.

Quoted 3 lines

Not sure whether we should document this somewhere (or modify the help text). It took me a few minutes to realise what is going on, so a warning somewhere seems in place.

Please feel free to extend / update the documentation, but eventually necessary shell escapes are beyond the scope of the help message.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Build a system that even a fool can use and only a fool will want  to
use it.