Short answer: you can't - it's impossible.
Once the subshell { VAR=$( echo "AAAA" ) ;}
is forked off with &
, it is a separate process, the child process. It inherits a copy of all variables in the original shell, but any or changes to those variables, or new variables it creates, remain within the child, and cannot be seen by the original (parent) shell. What's more, since you're not waiting for the child to finish, there is no guarantee that the child will even have set the variable at the point the parent wants to use it.
The only way to get the data back from the child to the parent is for the processes to communicate - this is called inter-process communication (IPC). There are many ways of doing this, with different characteristics, and hence different suitability for different tasks (and for use within the shell).
You say you don't want to use files or a pipe. I'm not sure why that is (it would be helpful if you said in your question), but other methods of IPC include:
- Sockets (unix domain, TCP etc)
- FIFOs
- Shared memory
- Signals
- Message queues
- ptrace
- etc...
Pick one :)