[ale] Awk question

Geoffrey Myers lists at serioustechnology.com
Tue Feb 7 10:39:59 EST 2012


Lightner, Jeff wrote:
> Any time I need to do floating point in a script I pipe it to “bc –l”.   
> Maybe not the most elegant way to do things but it works.

Awk handles floating point just fine:

echo|awk '{printf "%f\n", 1/3}'
0.333333


-- 
Until later, Geoffrey

"I predict future happiness for America if they can prevent
the government from wasting the labors of the people under
the pretense of taking care of them."
- Thomas Jefferson


More information about the Ale mailing list