I like bash as much as the next guy, but (to my surprise) /bin/sh on
my current workstation is actually dash. How about just replacing the
substring-interpolations with:
if [ $marker -ne 0 ]; then
beforemark=`echo "$code" | cut -c-$((marker - 1))`
[..]
# and fix code at-and-after marker
code=`echo "$code" | cut -c$marker-`
fi
and be done with it?
--
Arne.
-