a readlink alternative in bash test script