Showing posts with label shell. Show all posts
Showing posts with label shell. Show all posts

Thursday, August 2, 2007

Float number handling in Shell

I was having hard time using float number in shell programming.
Shell treat any number with . as a string. Then I got a trick to use bc ( binary calculator):

Usage:
num="echo $strnum | bc"