In some early shells, testing an empty string variable was not as easy as it is now, so the best alternative was to see if "x $ variable" was equal to "x". Also, since apparently using test, itβs easier than trying to correctly specify / exclude sequences such as "$ x! =" Y "without losing common sense and / or portability.