The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 03-18-2009
rockbike rockbike is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 11
Question print a multi-lines variable?

hi im trying a make simple html page with the content of some files
i have:
title=`cat "file1"`
heading=`cat "file2"`
para=`cat "file3"`
block=`cat "/file4"`
cat > ./page.html <<-EOF
<html>
<head>
<title>$title</title>
</head>
<body>
<h1>$heading</h1>
<p>$para</p>
<blockquote>$block</blockquote>
</body>
</html>
EOF

lets say file2 contains:
222
222

and file3 contains:
333

333

my script will only give me a html page with variables printed in single lines like:
222 222
333 333

the result i want should be:
222
222
333

333

sorry about the bad english and poor explaination, please help me
thank you