Quantcast
Channel: Take Command / TCC
Viewing all articles
Browse latest Browse all 2205

EXPR results to an environment varaible

$
0
0
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...

Read more

Viewing all articles
Browse latest Browse all 2205

Latest Images

Trending Articles



Latest Images