On Sun, 16 Mar 2003, Chris P wrote:
> How about an example? I know only know sed for replacing things, not > inserting a new line into a file in a specific place, even though the info > around it changes. > > > On Sat, 15 Mar 2003, Chris P wrote: > > > > > > > > Hello.. > > > Not really a freebsd question, but still a good forum to ask this. > > > How would I insert a line into a file via a csh script. example... > > > I have a file that is generated via the script, and I need to insert a > > > line between line 1 and 2. I could do it via a head, or tail statement, > > > and alot of steps, but I was wondering if there was an easier way to do > > > it. Exactly how you do it within your script depends on what else is happening, but this shows one way of doing it from the command line: cat originalfile | sed -n '1G;p' >modifiedfile Cheers, Viktor To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message
