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"
Showing posts with label shell. Show all posts
Showing posts with label shell. Show all posts
Thursday, August 2, 2007
Subscribe to:
Posts (Atom)