Do spaces matter with expr?

Dec 11, 2010 at 9:41pm

Do spaces matter with expr?

Hello,

I was recently explaining expr to someone and told him that the spaces between the arguments in the expression didn’t matter–meaning there can be white space like this:

$i1 + $i2 * $i3

or not like this:

$i1+$i2*$i3

It seems to work both ways, but I can’t see any definitive statement on spaces in expr.

Does anyone know if the spaces or lack thereof ever become an issue?

#53886
Dec 12, 2010 at 7:21am

spaces mean nothing.

you can think of the whole expression as a symbol, which is parsed and interpreted inside.

i find this very handy, because you can use spaces only where you want them for better readabilty:

$i1 + ($i2*$i3)

#193963
Dec 13, 2010 at 6:36pm

Thank you! Exactly what I thought.

#193964

You must be logged in to reply to this topic.