0

I'm using sshpass to get the output of different statistics of a machine.
However the output is all bunched together:

sshpass -p *****_PASSWORD ssh -o StrictHostKeyChecking=no mlinfra@$ADDRESS 'hostname; w; df -h; free'

Ideally I would like to have a new line in between the output of hostname, w, df -h and free

β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83

1 Answers1

1

It seems your question is just about formatting the output and independent from sshpass and ssh. So you could use just the echo command, i.e.:

ssh user@example.com 'hostname; echo; df -h; echo; free'

It will give you a new line in between the output of each command.

Thanks to

U880D
  • 8,601
  • 6
  • 24
  • 40