The exist code of a posix compilant shell is 0..255. Attempting to return -1 will error in some shells and implicitly cast to 255 in others. Fix it by returning a legal return value.