LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 06-05-2009, 03:27 AM   #1
kf_rocks
LQ Newbie
 
Registered: Jun 2009
Posts: 1

Rep: Reputation: 0
script to change a file header/banner with


Hi
I have got a task at work, to replace the file banners of some legacy code in our system, with some updates.
ie; at present the banner is something line

/**
* file ABC
* Author XYZ
* desciption blah.blah blah
*/


I have got to change to something like

/**********
* file ABC
* Date 1-1-1
* Author XYZ
* copyright info
* desciption blah.blah blah
* modified date
************/


This has to be done for a large number of files. So I am looking for a script by which I could automate the process. I am not very familiar with SED. So any help i get regarding this would be great.
 
Old 06-05-2009, 08:30 AM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,473

Rep: Reputation: 2540Reputation: 2540Reputation: 2540Reputation: 2540Reputation: 2540Reputation: 2540Reputation: 2540Reputation: 2540Reputation: 2540Reputation: 2540Reputation: 2540
Quote:
Originally Posted by kf_rocks View Post
Hi
I have got a task at work, to replace the file banners of some legacy code in our system, with some updates.
ie; at present the banner is something line

/**
* file ABC
* Author XYZ
* desciption blah.blah blah
*/


I have got to change to something like

/**********
* file ABC
* Date 1-1-1
* Author XYZ
* copyright info
* desciption blah.blah blah
* modified date
************/


This has to be done for a large number of files. So I am looking for a script by which I could automate the process. I am not very familiar with SED. So any help i get regarding this would be great.
Well, you're on the right track with sed. Post what you've written so far, and we can give you a hand. Otherwise, there are lots of tutorials on the web, that'll show you how to process all files in a directory.
 
  


Reply

Tags
script, sed


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
import c header file into a python script deathalele Programming 1 05-26-2009 09:50 AM
glibc change in header file sysdeps/unix/sysv/linux/bits/socket.h Bambi535 Linux - General 4 08-19-2008 02:45 PM
bash script - remove header row from csv file pljvaldez Programming 5 08-30-2006 11:05 AM
I want change mail header info, which config file i should modify? exper Linux - Software 2 12-05-2003 06:46 AM
change the banner for ssh [cacheflow] Linux - Security 5 09-16-2002 03:03 PM


All times are GMT -5. The time now is 05:23 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration