What you seem to be trying to do is version control and maintain a history. In general system administration staff don't want to be prompted and want the script to take care of everything. In this case, it could figure out a reference number like
. Your method of putting comments in from of changed stanzas will make the file grow. I would simply have a script that would make a backup of the file with a predetermined reference, number, then call of the vi editor to edit the file. The script could be smart enough to recognize if the file actually changed.
ok.. Thanks for your swift responce.. Let me tell you what i am trying to do here..
i am trying to edit "sysctl.conf" file.. if this file has got below variables with below values or morethan that then it should leave that value...
If variable value is less than that then it should alter the value to below given value
For example:
sysctl.conf file has below values
expecting output is
will you able to help me on this to write a script or weather i am going in right direction to achive above output by previously shared script
---------- Post updated at 09:39 AM ---------- Previous update was at 03:49 AM ----------
This is my script i am preparing to replace "kernel.shmall" if value is less than equal 4194303
script:
output of
is
it should take only kernel.shmall, not which are commented "#" like #kernel.shmall
I have one file and the file may contain 500 to 15,000 records. I need to search pattern ^F509= and then increment the corresponding value by one and print the entire line.
Please note that Its not a fixed length file. Can anyone please help?
ex: ^F509=204656
^F509=204656
... (6 Replies)
Need to implement new CRON job or modify the existing one in MDM PROD in coming days, which will send email of SQL statement running from past 1 minute.Currently there is one CRON job in PROD, which send below email.
there is one cron job which send email, when there is long running... (0 Replies)
Hello
I have a file as below
chr1 start ref alt code1 code2
chr1 18884 C CAAAA 2 0
chr1 135419 TATACA T 2 0
chr1 332045 T TTG 0 2
chr1 453838 T TAC 2 0
chr1 567652 T TG 1 0
chr1 602541 ... (2 Replies)
greetings,
i have the following env variable:
LSB_HOSTS='t70cra102 t70cra102 t70cra108 t70cra108'the variable could be any number of host names and sometimes the same name several times. i was hoping there's a way to turn it into the following:
NEW_LSB_HOSTS=,,,]always appreciate the help... (2 Replies)
Hi
I need to modify an excel file in perl and for which I installed perl in
Linux
1. Open a existing excel file
2. delete an unwanted Sheet called "summary"
3. and i want to insert some data into range of cells ( B1:B11)
4. Remove unwanted value called "Sum" repeated in the... (1 Reply)
I want to look into a folder to see if there are any folders within it. If there are, I need to check inside each folder to see if it contains a .pdf file
So
If /myserver/myfolder/
contains a folder AND that folder conatins a .pdf file
do X
Else
do Z
I may have multiple folders and... (4 Replies)
Hi,
I know that to create a pdf file I can use the txt2pdf command.
But if I would change an existing pdf file, by inserting lines in particular positions of this file, what can I use? And How? (3 Replies)