That isn't assignment, that is math operators, which are not part of the
standard bourne shell ability set.  Shells just can't do that.  You are
spoiled by the bloated bash, which of course includes a calculator...

The way to do this on tomsrtbt is something like:

a=`lua -e 'print('"$b"'+'"$c"');'`

or

a=$(lua b=$b c=$c -e 'print(b+c)')

you get the idea...  See /usr/man/lua...

-Tom


On Sun, 31 Mar 2002, Robert Foster wrote:

> Date: Sun, 31 Mar 2002 13:40:32 -0800 (PST)
> From: Robert Foster <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [tomsrtbt] Simple shell assignment
>
> I am having trouble with shell script simple
> assignment statements. (using version 1.7.361 of
> tomsrtbt)
>
> What I want to do is simply do math in the script,
> like
> a=b+c.
>
> This can be illustrated at the shell prompt as
> follows:
> #echo 3+5
> We get, as expected,
> 3+5
> So we should do it this way:
> #echo $((3+5))
> Unfortunately, we get
> 3+5: not found
>
> Other similar forms such as
> #a=3
> #b=5
> #c=$(($a+$b))
>
> complains about "3+5" not found also.
>
> "let" and "expr" doesn't seem to work.
>
> What am I doing wrong?
>
> TIA, Bob
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Greetings - send holiday greetings for Easter, Passover
> http://greetings.yahoo.com/
>

Reply via email to