2

I want to print commands on remote server one after other in new line

echo "Hostname is: `hostname`"
echo
echo "Disk Space is: `df -h /`"
echo
echo "free Space is: `free -m`

i get following output

Hostname is:   echo Disk Space is: Filesystem               Size  Used Avail Use% Mounted on
/dev/mapper/centos-root  /

Its not printing on new line

2
  • Put your executed commands inside like ${history} and put semicolons between echo statements.
    – beroe
    May 10, 2018 at 6:27
  • Thanks for your help! It worked May 10, 2018 at 6:34

1 Answer 1

0

Use this form instead:

echo "Hostname is: $(hostname)"
echo
echo "Disk Space is: $(df -h)"
echo
echo "free Space is: $(free -m)"

Not the answer you're looking for? Browse other questions tagged or ask your own question.