On 7/27/06, Karl O. Pinc <[EMAIL PROTECTED]> wrote:
I've not tried to scroodle what you're trying to do,
but expr is integer-only.  That's your problem.

And it's not really relevant to pf.

When faced with problems that look like this I usually
use awk with a awk script on the command line
mixed in with the regular shell scripting.
Mostly because it's not perl so there's
an upper limit to how crazy the script can get.

Is that really an advantage? :-)  Perl can do everything awk can do,
then some.  There's even an automatic awk-to-perl translator.

Anyhow, you might find "dc" easier to use from the command line than bc.

Merely replace the expr command with:
echo $PORT_IN_SUM $PORT_IN + p | dc

It takes RPN, so the + is at the end, and the p means print the value
on the stack.
--
"if you're not part of the solution, you're part of the precipitate"
Unix "guru" for rent or hire || http://www.lightconsulting.com/~travis/ -><-
GPG fingerprint: 9D3F 395A DAC5 5CCC 9066  151D 0A6B 4098 0C55 1484

Reply via email to