Is it possible to convert strings to math operators?

someone <[email protected]>
Newsgroups alt.comp.lang.awk
Organization Ministry of Madness
Message-ID <[email protected]>
I didn't see anything in the gawk(1) manpage for doing this but it seems 
like it should be possible.

ex.  oz to lb using old-school units(1) command:
--
$ units -1 oz lb
    * 0.0625

# this works:
$ echo "16 $(units -1 oz lb)" |awk '{print $1 " oz = " $1 * $3 " lb"}'
16 oz = 1 lb

# this does NOT work:
$ echo "16 $(units -1 oz lb)" |awk '{print $1 " oz = " $1 $2 $3 " lb"}'
16 oz = 16*0.0625 lb

--

Is there a way to tell (g)awk to interpret strings like "*", "/", "+", 
"-", etc. as actual math operators?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.