I need a multi-line output over SSH remote command.
If I use this command on the local machine, I have correct output:
sudo docker stats --no-stream container1 container2 container3 | awk '{if (NR!=1) {print $1,$9,'$(date +%s)'}}'
container1 72.85 1471958776
container2 14.83 1471958776
container3 9.362 1471958776
If launched remotely, it strips the line feeds:
ssh -o LogLevel=QUIET -t -i key.pem user@host sudo docker stats --no-stream container1 container2 container3 | awk '{if (NR!=1) {print $1,$9,'$(date +%s)'}}'
container1 72.85 1471957426 container2 14.83 1471957426 container3 9.362 1471957426
How can I get the same result as the local output, one per line?