Aren't you by chance running this under something like tcsh and not bash? if you don't know how to determine that - see e.g. here: bash - How to determine the current shell I'm working on? - Stack Overflow
So I have to change to bash?
By the way, what is the difference between oe-init-build-env and oe-init-build-env-memres?
I think bash is the way to go, yes.
I don't know what that memres one is, never used that. The standard BSP build process uses oe-init-build-env