Reflash the Z.
Did you installed bash to SD?
That could be a problem with the link /bin/sh -] /bin/bash not existing or /bin/bash not being found.
[EDIT] Which can happen if you installed bash to SD and while booting it isn\'t mounted yet, so your /bin/bash -] /mnt/card/bin/bash points to someplace which doesn\'t exist. [/EDIT]
Next time you install bash, make /bin/sh link to busybox like it should, and use /bin/bash in /etc/passwd as your shell. Since bash and busyboxs\' sh aren\'t always compatible and bash being used instead of sh can break some scripts.
You\'ll have to:
If you have the repositories configured:
# ipkg -V1 install bash -dest root
# cd /bin
delete the symlink from sh to bash
# rm -f sh
create a new one which points to busybox
# ln -s busybox sh
edit /etc/passwd and change /bin/sh to /bin/bash for root
bash needs libncurses, which has to be installed too.