How to put value of echo pipe netcat commands into variable

view story

http://unix.stackexchange.com – I have this command succession: echo -ne "/dev/shm/test.sh" | netcat 4567 and let's say it return a string like, for example "Hello...bla". (on the i have made a server that takes ssh comands and executes them and returns the result to the client, and it is running ok, it return what i need, so this is not the problem) I want to put this returned value, "Hello...bla", into a variable and use it. If i try this: var=echo -ne "/dev/shm/test.sh" | netcat 4567;echo "$var" it doesn't work... Bash returns this: -bash: -ne: command not found Can you ple (HowTos)