[SunHELP] A simple subtract problem

Nicholas Dronen ndronen at frii.com
Fri Feb 15 08:21:11 CST 2002


On Fri, Feb 15, 2002 at 03:22:39AM -0800, Giura Paul wrote:
> Hi,
> 
> In bash script this command work 
>     x=15
>    let x=$x-1
> But with SUN standard shell not work.

The Bourne shell is a bit of hassle when
it comes to arithmetic (and a lot of other
things, for that matter).

$ x=1
$ x=$((x-1))
$ echo $x
0

Regards,

Nicholas Dronen



More information about the SunHELP mailing list