floating-point in script
hi
i'm writting a script that contains the following variable size2=$(($size1 + $size2)) but when it tries to add numbers like 6.1 all i get is syntax error in expression (error token is ".1") i tried bc size2=$(($size1 + $size2)) | bc and i get the same any hints? |
Which language?? or shell script??
Happy Penguins!! |
Quote:
|
Hi.
Your bc command should look like: Code:
size2=`echo "$size1 + $size2" | bc` |
thanx dave for your reply
but i already tried that and it produces the same error!!! |
Code:
#!/bin/sh |
thanx but i just rewrite it all in korn and worked.
Code:
#!/bin/ksh |
All times are GMT -5. The time now is 07:10 PM. |