| Ed Morton 2006-01-13, 6:56 pm |
|
eldiabloinfernal wrote:
> hi gurus,
>
> I have the following problem.
>
> I have a file and would like to insert a line of text at the top and a
> line of text at the bottom.
>
> eg:
>
>
> -----top of file -----------
>
> <insert start line here>
> abcd
> defg
> hijk
> lmno
> <insert end line here>
>
> -----e bottom of file ----------
>
>
> Is there a quick way of doing this ? I currently use cat (file1 file2
> file3) > filex but it is not very fast and efficient. I would like to
> use a method which uses little resource and is fast.
>
> many thanks in advance
>
> dean
awk 'BEGIN{print "start"}1;END{print "end"}' file
<OT>
This would probably be faster if you use UNIX shell:
echo "start"; cat file; echo "end"
Follow up at comp.unix.shell if you don't specifically need an awk solution
</OT>
Regards,
Ed.
|