The roots of an obscure Bourne shell error message

If you accidentally put a space after the equals sign when trying to capture information into a shell variable in Bourne shell code, you will encounter the error message “command not found”. This error arises from a series of decisions made in the traditional Unix and Bourne shell. The Bourne shell allows for temporary setting of environment variables for a single command, and commands can be named through indirection. The combination of these features, when used incorrectly, leads to the obscure error message. It is difficult to prevent this error with a simple change in the Bourne shell because each component individually makes sense. However, tools like shellcheck can help identify these issues.

To top