echo switches

Hello All,

I am writing an shell script but abruptly its not able to recognize switches in echo statement.

#!/bin/bash

top -n 1 -b>ankit

host=`hostname`

time=`cat ankit|grep load|tr -s " "|cut -d " " -f3`

load=`cat ankit|grep load|tr -s " "|cut -d "," -f4|cut -d ":" -f2`

mem=`cat ankit|grep Mem`

swp=`cat ankit|grep Swap`

echo "Machine Name: $host">>mcs

echo "Time when snapshot taken $time">>mcs

echo "\n\n current Load Average of the system is$load">>mcs

echo "\t\t Memory Utiliztion on the server">>mcs

echo

cat mcs|mail -s "Top Usage Report" b36376@freescale.com

output

#########

Machine Name: zin33cde01
  Time when snapshot taken 16:18:45
  current Load Average of the system is 5.45 \t\t Memory Utiliztion on the server

###########

like in the above output ist not parsing \t\t for tabing.

Regards

Ankit

try with `-e `

echo -e "\t\t Memory Utiliztion on the server">>mcs

Thanks for your reply.Can you please let me know why its not running without -e.

Can you also let me know how can i highlight important things using the script link bold or italics the text.

Regards

Ankit

backslahs is interpreted in \t \n \r with `-e`

-e     enable interpretation of backslash escapes

for other question you can look this page :wink:
Colorizing Scripts

regards
ygemici