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`

--
David Lupo <[EMAIL PROTECTED]>



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

Reply via email to