Version Control Through the Shell Script
Hi Guys,
Apologize for the big request, please take some time and read it completely... This is Very important for me, and ur help is Very much Appriciated.
I want to maintain the Version control to all my scripts running in Production server, I am not allowed to use any tool like Perforce,clearcase, etc... So thought to write the script for it, which manages the Version control to my scripts which are changing everytim,
Here is the brief about my plan about it, please suggest how can I implement it, or also if there is another way to do it through script,that will be v helpful...
I have around 100 scripts under one folder, for example /home/Anji
I am planning to create one more folder under it namely Versions, like /home/Anji/Versions.
and copy all the 100 scripts under the versions folder without any content in it(Blank Scripts) with VC extension[To understand this is a VersionContraol file for the script]
For Ex:
One of my script under /home/Anji is batch_Trades.sh, which contaned 1000 lines of code,which will be changed when ever there is a request from users...
I will create the same script name batch_Trades.sh_VC /home/Anji/Versions folder...
So Everytime when I change the original script batch_Trades.sh I want to record the Version control in batch_Trades.sh_VC file in below manner,
####################################################
Version: 1.0
Script Name:
CR Number:
Date:
Reason for changing the script:
Change Implementer:
####################################################
For the first We need to define the pattern, and from 2nd time onwords,Version must be change dynamically [may be we can get the version id from previous version and do +1 to that) For all the other fields in the pattern, we need to give them from the command line when we run the script like below..
$./Version.sh batch_Trades.sh [Below is the command output script needs to ask when we run]
Do you want to continue (y/n) : y
What is the Script Name: batch_Trades.sh
What is the CR Number: 12345
What is Change Date: 02-11-2010
Reason for changing the script: Businmess Requst
Who is the Change Implementer: Anji
Finished Script....
$
Once all the Information is Given then, automatically this information should append to the VC file which is under /Home/Anji/Versions folder, i.e., batch_Trades.sh_VC
This is little bit big mail.... but i just wnated to give the full details to understand better.
Thanks In Advance Guys