[prog] awk error

Pinar Yanardag pinar at comu.edu.tr
Fri Mar 21 07:01:43 UTC 2008


Hi Diana,

Problem occurs while passing parameters from echo to awk. If it's 
possible for you to try something like this, you'll get the correct value:

awk -v e1="60" -v e2="6.510417E-05" 'BEGIN {print e1*e2}'

Btw, I'm still searching echo2awk problem, it's so interesting..

Cheers,

Pinar Yanardag
http://pinguar.org/blog


Diana Ionescu wrote On 21-03-2008 03:43:
> Hello,
>
> I finally discovered the error in my codes (shell sccripts & c/c++) ...
>
> I have a fresh new gentoo64 installed with 2.6.24-gentoo-r3, gcc-4.1.2, GNU Awk 3.1.5
>
> So here is the *thing*
> echo 60 6.510417e-05 | awk '{print ($1*$2)}'
> 360
>
> when it should be: 0.00390625 (which I get on a different computer)
>
>
> How can I enable the exponential readings? Or where is it coming from?
>
> I should specify that I not sure if I can change the outputs of the codes into "normal" writing numbers.
>
> Any help is very much appreciate.
>
> Please excuse me if this is not exactly a programming problem.
>
> Many thanks,
> Diana
>
>
>
>       _____________________________________________________________________________ 
> Envoyez avec Yahoo! Mail. La boite email la plus appreciée au monde. http://mail.yahoo.fr
> _______________________________________________
> Programming mailing list
> Programming at linuxchix.org
> http://mailman.linuxchix.org/mailman/listinfo/programming
>   



More information about the Programming mailing list