How do you launch the script ? ash script.sh ? (I'd guess this one since you use #! /bin/sh ...) or script.sh ? Have you tried after apt-get purge bash ?