🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac.programmer.codewarrior
Article #167

Re: Update on Open PowerPlant

#167
From: David Phillip Oster
Date: Mon, 09 Jan 2006 18:31
43 lines
2572 bytes
In article <ron.liechty-FD31C2.12473009012006@news.newsguy.com>,
 Ron L <ron.liechty@freescale.com> wrote:

> If anyone has a script for adding headers to text files, send it 
> directly to me.  I'm not good at scripting so any SED or python or 
> anything you can send me is appreciated.

The easiest way to do it is to put the boilerplate at the END of the 
file, that way, comments at the top that describe the file aren't 
disturbed. Here is a shell command, adder, used like this:

% ./adder *.c *.h

that appends boilerplate to each file.

#!/bin/sh
for i in $* 
do 
cat >> $i <<HERE_DOCUMENT
Simulated boilerplate line 1 here.
Simulated boilerplate line 2 here.
HERE_DOCUMENT
done





If that isn't good enough, here is a revised "adder" that adds the lines 
to the beginning:

#!/bin/sh
for i in $* 
do 
ed $i <<HERE_DOCUMENT
0a
more boilerplate line 1 here.
more boilerplate line 2 here.
.
w
q
HERE_DOCUMENT
done
Technical Details
Message-ID: <oster-5D1FC2.10314909012006@newsclstr02.news.prodigy.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsmst01b.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr12.news.prodigy.com.POSTED!1d19eb8e!not-for-mail
References: <ron.liechty-FD31C2.12473009012006@news.newsguy.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f635e,4f263845244c18f9
X-Google-Thread: f7f77,4f263845244c18f9
X-Google-Thread: 10bcce,4f263845244c18f9
X-Google-Attributes: gidf635e,gidf7f77,gid10bcce,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsmst01b.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr12.news.prodigy.com.POSTED!1d19eb8e!not-for-mail
From: David Phillip Oster <oster@ieee.org>
Newsgroups: comp.sys.mac.programmer.codewarrior,comp.sys.mac.oop.powerplant,codewarrior.mac
Subject: Re: Update on Open PowerPlant
References: <ron.liechty-FD31C2.12473009012006@news.newsguy.com>
Posted-And-Mailed: yes
User-Agent: MT-NewsWatcher/3.4 (PPC Mac OS X)
X-Face: iR>C6?LNAcg&!xxr{}\7y$W@~UW,\:5'<H=KmFr^OY!`48#Nqao]VO#+oxocr        ="e"*!AxDM1my!y7uoK4<&hQ-9c\KxG_b3eD{JlM2+r0BYXAo<~N|g'3p<tXe37b[79@        ?46JFrQ?^D479N=<Au~;,ax]LOils0QyP.qY!Mw5o'2$<qA{V)<J-<2Y8K
Message-ID: <oster-5D1FC2.10314909012006@newsclstr02.news.prodigy.com>
Lines: 43
NNTP-Posting-Host: 69.230.8.214
X-Complaints-To: abuse@prodigy.net
X-Trace: newssvr12.news.prodigy.com 1136831509 ST000 69.230.8.214 (Mon, 09 Jan 2006 13:31:49 EST)
NNTP-Posting-Date: Mon, 09 Jan 2006 13:31:49 EST
Organization: SBC http://yahoo.sbc.com
X-UserInfo1: SCSGWYKGAJWWCTXYZBCBNWX@RJ_XPDLMN@GZ_GYO^ZWZUYICD^RAQBKZQTZTX\_I[^G_KGFNON[ZOE_AZNVO^\XGGNTCIRPIJH[@RQKBXLRZ@CD^HKANYVW@RLGEZEJN@\_WZJBNZYYKVIOR]T]MNMG_Z[YVWSCH_Q[GPC_A@CARQVXDSDA^M]@DRVUM@RBM
Date: Mon, 09 Jan 2006 18:31:49 GMT