Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Dec 1996 16:52:06 +0800 (CST)
From:      sln@public.jn.sd.cn
To:        questions@freebsd.org
Subject:   shell programming
Message-ID:  <Pine.SOL.3.91.961204164334.2113A-100000@public.jn.sd.cn>

next in thread | raw e-mail | index | archive | help
Hi,

I want to calculate intergers under Bourne Shell, I input the following:

a=10 <enter>
a='expr $a+10' <enter>

when I typed "echo $a", the result from system is "expr $a+1" just the 
same as I typed it in the command, but as the "expr' manul says, the result 
should be "20", what's the problem? 

Further more, I want to know a general way to do some calculation using 
variables under unix shell.

Thanks in advance!

Song



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.3.91.961204164334.2113A-100000>