Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Block of Text to VAR 1

Status
Not open for further replies.

jtanner

Technical User
Feb 18, 2007
39
US
Hello,

On a Sun Solaris systen from a Bourne shell script I have several static lines (35) of text that I need to store in a variable.

The hard way would be like:
Code:
VAR="Line 1"
VAR="$VAR Line2"
VAR="$VAR Line3"
...

Or perhaps outputting it into a file then into a variable.

I think what I am look for is to be able to take the text as an entire block but dont quite know the syntax.

Something like this (would this work - if coded right):
Code:
VAR <<
Line 1
Line 2
Line 3 ...
VAR

echo "$VAR"

Many thanks,

JT
 
feherke,

Your post was simple and perfect.

I guess I was making it too hard. :)

Thanks,

JT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top