> > I would love to use something off the shelf like awk, or even dc, but I
> > don't really want to add another 25K (dc) to 100K (mawk) binary just to
do
> > some simple addition and subtraction on byte/packet counts, since I
think a
> > lot of folks running on floppy would still like to use this, and most
floppy
> > installs are pretty pressed for size...
>
> Oooo, I forgot the ``cost'' of adding [m]awk . . .
>
> Does ash support arrays?  I think that you're going to need it . . .

No array support in ash, but it's not really necessary, just convinent.
What would be even nicer is a bit more string functionality, but I think I
can do everything I need with the available parameter expansions (ie
${parameter%word}, ${#parameter} and similar).

The resulting code will probable be pretty slow compared to compiled code,
but it should be pretty small (probably a few hundred bytes for arbitrary
precision add/subtract routines).  OK, they won't likely be 'true' arbitrary
precision, but the limits would be set by the maximum size of a shell
variable, and maximum recursion depth for functions.  I think both limits
are pretty big (but not arbirarily large)...certianly big enough to handle
byte counts for even a busy router with a long uptime...

Charles Steinkuehler
http://lrp.steinkuehler.net
http://c0wz.steinkuehler.net (lrp.c0wz.com mirror)





_______________________________________________
Leaf-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/leaf-user

Reply via email to