Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Adding text to the beginning of a file



TLUG,

I'm writing a bash shell which will write today's date and some other info at the top of a bunch of PHP files.

I believe that ordinarily, the command "cat" is used for this. However, unless I'm mistaken, "cat" will always add text to the beginning of the file.

What I'll need to do is to over write some text up to a particular point.

So, if at the top of my PHP file it says:

# File modified 2007 03 16
# by Dave M G
# --

Can I wipe out everything up to and including the "--" and then past in new text?

--
Dave M G
Ubuntu 6.10 Edgy Eft
Kernel 2.6.20-5-generic
Pentium D Dual Core Processor
PHP 5, MySQL 5, Apache 2




Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links