For Sydney 10/8/2008, who writes:
AWK in my usage of it only appears to evaluate the first number of the “20%”. so I ask; What usage of AWK should I implement to make 1 compare lower than 10.
Unix awk does not have strtonum but you don't need it, nor substr. The problem is that variables are treated both as string and numeric by the comparison operators. Trick is to typecast to numeric using (0 + expression), or to string using ("" expression), to force the right comparison. For a variable $3 like 17%, use x = 0 + $3 to assign the 17 part to x.
I am being sponsored by Syntress! They bought me an amazing dedicated server to run catonmat on. If you're looking web services, I highly recommend the Syntress guys!
Education Sponsors
I am being sponsored by A-Writer! If you ever need help with essay writing, look no further than A-Writer! They will help you with your writing in as quickly as 3 hours!
For Sydney 10/8/2008, who writes:
AWK in my usage of it only appears to evaluate the first number of the “20%”. so I ask; What usage of AWK should I implement to make 1 compare lower than 10.
Unix awk does not have strtonum but you don't need it, nor substr. The problem is that variables are treated both as string and numeric by the comparison operators. Trick is to typecast to numeric using (0 + expression), or to string using ("" expression), to force the right comparison. For a variable $3 like 17%, use x = 0 + $3 to assign the 17 part to x.
Reply To This Comment