I want to store the output from an netcat function into a variable. I tried a lot of different ways, but it doesn't work to me. Can someone help me? The whole scripting thing is whole new for me!
#! /bin/sh
while true;do
var = "$(echo "RDTEMP1" | netcat -q2 sanderpi 5033)"
echo &(var)
echo "$(date +%Y-%m-%d%t%H:%M:%S)"
done