When I use following echo statements I get a nice output which is what expected from such three separate echo statements:
echo AP $macaddr
echo noise floor $noise
echo $channel
Output:
AP ac:67:06:30:eb:00,
noise floor -96
channel=1
But when I change all three into one single ‘echo’ statement like the following, output breaks.
echo AP $macaddr noise floor $noise $channel
Output:
channel=06:30:eb:00, noise floor -96
In this output I don’t see the channel and MAC Address is missing two of its first octets.
What is causing this? How can avoid this?
I don’t know where channel comes from, but is there a spurious ‘CR’ at the start of the value of $channel or end $noise?
Try doing:
…and seeing if that makes a difference. Failing that, see if there’s any other dodgy chars in $channel and $noise (and any of the other variables):
and if there are, use
tr -dto remove them from the variable.