Hi,
I have below shell script..
$ cat /tmp/1.txt
NAME-HOST-APPLIED TIME-DATE
$ cat /tmp/1.sh
#!/bin/ksh
echo "<html><table border size=1>" > /tmp/mail.html
for i in `cat /tmp/1.txt`
do
a1=`echo $i |cut -d "-" -f1`
a2=`echo $i |cut -d "-" -f2`
a3=`echo $i |cut -d "-" -f3`
a4=`echo $i |cut -d "-" -f4`
echo "<tr><td>$a1</td><td>$a2</td><td>$a3</td><td>$a4</td></tr>" >> /tmp/mail.html
done
echo "</table></html>" >> /tmp/mail.html
$
When i execute the script /tmp/1.sh i am getting the output like below..
$ sh /tmp/1.sh
$ cat /tmp/mail.html
<html><table border size=1>
<tr><td>NAME</td><td>HOST</td><td>APPLIED</td><td></td></tr>
<tr><td>TIME</td><td>DATE</td><td></td><td></td></tr>
</table></html>
$
But i want the output like
<html><table border size=1>
<tr><td>NAME</td><td>HOST</td><td>APPLIED TIME</td><td>DATE</td></tr>
</table></html>
I am not getting the desired ouptput since "APPLIED TIME" have space in between words.
Please help how can i get desired ouptput... i.e.,
"<tr><td>NAME</td><td>HOST</td><td>APPLIED TIME</td><td>DATE</td></tr>"