I have a script that backs-up remote systems, and want it to display disk space on the remote backup device prior and post running backup script.
Thanks to another post have learnt how to run remote commands via SSH such as (SSH keys have been setup for auto login).
echo `ssh -t user@host uname -a`
However, how can I get a multi line response that comes from a command such as
echo `ssh -t user@host df`
Response just shows the last line of output from df
Best Answer
That sounds overly complicated way to SSH somewhere and call a command.
Just type:
Voila. :)
Edit 1
Example of remote output parsing:
Outputs comma separated list of mountpoint,availablespace like: