June 3, 2010

ssh read output

Forums: 

With the help of ssh i would like to execute script and redirect the output in my local file

$ssh -i keypair1.pem root@ -C sh /mnt/monitor.sh >> /root/imgManagementOutput.txt

source: monitor.sh
echo `cat /mnt/imageOutput.txt`

Source: /mnt/imageOutput.txt
line1
line2

Expected Output:
line1
line2

Actual Output:
line1 line2

I am looking for the output should be as "Expected Output" as it is not in a single line...

Click Here!