On 16:15 26 Feb 2002, David Lupo <[EMAIL PROTECTED]> wrote:
| On Wed, Feb 27, 2002 at 02:30:45AM +0530, [EMAIL PROTECTED] wrote:
| > echo Enter a value
| > read number
| > 
| > answer=(echo 0.245 \* $number)|bc
| > echo $answer
| > 
| > but answer remains a null variable always
| > How do I carry out calculations using non integer values then ?
| 
| The calculation is working, but you have left out the back-ticks (`)
| around the expression to capture its output into the shell variable.
| Try
| 
| answer=`(echo 0.245 \* $number)|bc`

And you don't need the (brackets) either.
-- 
Cameron Simpson, DoD#743        [EMAIL PROTECTED]    http://www.zip.com.au/~cs/

We tend to overestimate the short-term impact of technological change and
underestimate its long-term impact.     - Amara's Law



_______________________________________________
Seawolf-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/seawolf-list

Reply via email to