Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

EXPR results to an environment varaible

Aug
2,799
144
EXPR evaluates an expression and displays the result on STDOUT.

I would like to suggest that the result also be saved to an environment variable,
perhaps _expr,
so that it can be used in the next expression:

Example;
Code:
expr %_expr * 10

I can do this now as follows...
Code:
U:\>alias expr=`set _expr=%{*expr %$} & echo %_expr`

U:\>expr 10 * 2
20

U:\>echo %_expr
20

U:\>set _expr
20

U:\>expr %_expr * 2
40

U:\>echo %_expr
40

U:\>set _expr
40

U:\>

...but it would be nice to have it built-in,
instead of using an alias.

Joe
 
Back
Top