[.home.]
[.hacks.]
Shell Scripts
It is sometimes quite challenging to try to squeeze a lot out of a
limited programming environment. I was faced with the problem to
convert
an ip-address to hex-digits in a bourne-shell script. Instead of using
external commands, I tried to use built in functionality only. The
result is a set of useful shell functions for converting numbers
between hex-, decimal- and binary-format as well as some for simple
math resp. logical operations.
For speed reasons I tried to avoid backticks operators for
assignments and made heavy use of the eval command. As a result no
fork() is necessary for any of the functions.
If you have improvements, fixes or additions feel free to contact me.
Have fun.
[.math.sh.]