In the interactive mode everything looks fine:
$ str="Hello World"
$ echo $str
Hello World
Obviously(!) as Johannes said, no space around =
. In case there is any space around =
then in the interactive mode it gives errors as
No command 'str' found