Okay, that kinda makes sense
now, why do you want to write a script for that? If there are no commands with the mis-spelled name, it will say
Code:
bash: foo: command not found
or something similar. If it happens to be the name of another command, it will run that command...