[TriLUG] solved: HERE document question

Joseph Mack NA3T jmack at wm7d.net
Sun Aug 1 18:50:51 EDT 2010


On Sun, 1 Aug 2010, Jeff Schornick wrote:

>> http://pastebin.com/7nxNCnXw
>
> How about a different take?
>
> My experience, from the joys of inheriting old scripts, is 
> that here documents just muck up readability and 
> maintainability.  Why don't you separate your code from 
> data by using two files, then use sed to cleanly do the 
> substitutions?

Hi Jeff,

 	I use sed to mangle files that I have no control 
over, eg putting javascript into the automatically generated 
html output from xsltproc,

 	I've not thought about using it for files that I 
control the contents of. I usually find I don't understand 
my sed statements when I come back to them later, no matter 
what comments I put in the code. I cringe when I put a sed 
file away containing chains of \\\\, knowing that when it 
breaks, I'm going to have hell to pay to fix it.

 	I'm glad to know that there's people like you out 
there who enjoy writing sed scripts. Maybe I should start 
thinking of sed as a normal tool, rather than a last resort.

>  myvar="TriLUG rocks!"
>  echo $myvar
>
> Hope you like it.

:-)

Joe

-- 
Joseph Mack NA3T EME(B,D), FM05lw North Carolina
jmack (at) wm7d (dot) net - azimuthal equidistant map
generator at http://www.wm7d.net/azproj.shtml
Homepage http://www.austintek.com/ It's GNU/Linux!



More information about the TriLUG mailing list