If I try following:
varReturn=$(ls)
echo $varReturn
it shows me the correct output of the listed elements in the directory.
But if I try this one:
varReturn=$(/opt/vc/bin/tvservice -n)
echo $varReturn
it doesn't show me the expected output :/
My goal is to check if an HDMI Port is connected or not. It' very curious for me, why it works only for some commands.
I'm looking forward to getting some help here. I didn't figure out, what the problem is.
EDIT:
Now I've found another way and tried following:
varReturn=`tvservice -s`
echo $varReturn
this shows me the correct output:
But if I use another command, like this one:
varReturn=`tvservice -n`
echo $varReturn
It shows me no output at echo, but the output from the var (confusing).

It still shows me the output if I use following code:
varReturn=`tvservice -n`
#echo $varReturn
The output is shown without the blank space.

varReturn=$(ls)\necho $varReturnwithls, similalry just use/opt/vc/bin/tvservice -ninstead of putting it into a variable and echoing the variable./opt/vc/bin/tvservice -nin command prompt manually and see if you get any output?