BASEDIR found the directory of the link (/usr/bin/erl in my case) to cean/start.sh rather than the directory of cean/start.sh itself, and ARCHDIR came out as Linux-x86 rather than linux-x86.