Sponsored Content
Top Forums Shell Programming and Scripting Bash shell: Replace a text block by another Post 302752391 by om1559 on Monday 7th of January 2013 01:56:46 AM
Old 01-07-2013
in fact, I need that in a script that automates installation & configuration of a product.
since there in a bug in one of JavaScript files of the product, the content of one of fuctions should be replaced by something else.
I should install this product several times per month; therefore I'm preparing a script that does all necessary post-installation tasks with minmum manual actions.

---------- Post updated at 07:56 AM ---------- Previous update was at 07:52 AM ----------

new text block is supplied in another file; and will be replace the entire function ABC block.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

find, copy and replace text in bash or sh

here is my prob .. i have a very large text files and i need to locate specific lines, copy them and then replace a single word in the replaced text example find all lines that contain '/etc', copy the line immediately below (not at the end of the file) and then replace '/etc' with '/root'... (1 Reply)
Discussion started by: jmvbxx
1 Replies

2. Shell Programming and Scripting

Shell Script to replace text

I need a little help with a shell script. I want to be able to specify parameters so that the script searches multiple files (specified as parameters) and only modifies the file if it finds the string of text. For the files it doesn't find the string of text within, it should leave it alone. ... (4 Replies)
Discussion started by: joebaber
4 Replies

3. Shell Programming and Scripting

Replace text block in multiple files

I need to replace (delete) a text block in a bunch of files, its a html table, almost at the end of pages but the location varies. In Windows I used Filemonkey, but nothing like that in Unix? There is replace from mysql, but how does it deal with newlines? sed only works with single lines,... (6 Replies)
Discussion started by: eiland
6 Replies

4. Homework & Coursework Questions

Help with bash shell to alter text file

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: My first question pertains to the adding a book section, I'm unsure which command or conditional statement I... (0 Replies)
Discussion started by: Vitrophyre
0 Replies

5. Shell Programming and Scripting

replace block of text with content of another file

Hello, file1: not to be changed not to be changed <start> old stuff old stuff old stuff <end> not to be changed not to be changed file2: new text new text desired output: (3 Replies)
Discussion started by: ripat
3 Replies

6. Shell Programming and Scripting

Using shell to replace characters in a text file

Can I just say, this is such a frustrating and yet enormously rewarding field of study. I'm in the middle of configuring GeekTool (Uh oh, stupid n00b) and I really only have one question. I'm using Automator to grab a RSS feed, having GeekTool continually run that application every 10 minutes,... (7 Replies)
Discussion started by: SomeTechGuy
7 Replies

7. Shell Programming and Scripting

using sed/awk to replace a block of text in a file?

My apologies if this has been answered in a previous post. I've been doing a lot of searching, but I haven't been able to find what I was looking for. Specifically, I am wondering if I can utilize sed and/or awk to locate two strings in a file, and replace everything between those two strings... (12 Replies)
Discussion started by: kiddsupreme
12 Replies

8. Shell Programming and Scripting

How to replace word with multiline text using shell scripting.

Hi all I have data files which contain data as shown below: Line 5: FIDE INST_DESC: DIAM Co Ltd/Japan => MAID Co Ltd/Japan INST_NME: DIAM Co Ltd/Japan => MAID Co Ltd/Japan Line 6: FIDE INST_DESC: DIAM DL/Pimco US Bond Open Born in the USA => MAID DL/Pimco US Bond Open Born in the... (6 Replies)
Discussion started by: Ganesh_more
6 Replies

9. Shell Programming and Scripting

Shell or perl script to replace XML text in bulk

Hi, I am looking for assistance over shell or perl (without XML twig module) which replace string in XML file under particular branch..example of code file sample.. Exact requirment : Replace "Su saldo es" in below file with "Your balance" but only in XML branch of Text id=98 and Text Id=12... (7 Replies)
Discussion started by: Ashu_099
7 Replies

10. Shell Programming and Scripting

Bash script to replace text file from a lookup file

Hi. I need assistance with the replacing of text into a specific file via a bash script. My bash script, once run, currently provides a menu of computer names to choose.The script copies onto my system various files, depending what computer was selected in the menu.This is working OK. Now, I... (1 Reply)
Discussion started by: jonesn2000
1 Replies
kreg(8) 						      System Manager's Manual							   kreg(8)

NAME
kreg - Maintains the system file that registers kernel layered products SYNOPSIS
/sbin/kreg -d subset [-c NAME] | -l vendor subset path [-c NAME] OPTIONS
Causes the specified layered product to be loaded or deleted from the NAME.list file for the given name in addition to the /usr/sys/conf/.product.list file. Note that the NAME parameter is case sensitive and must exactly match the NAME prefix for the desired NAME.list file. Deletes the entry for the specified layered product when you remove it from the system. Loads the data that controls how to include the layered product in the kernel build process. DESCRIPTION
The kreg command maintains the /usr/sys/conf/.product.list system file, which registers static kernel layered products. The kreg command creates the file if it does not exist. The file enables system utilities or user supplied commands to locate the kernel parts of a layered product, and it provides information about layered products. The kernel tools use the /usr/sys/conf/.product.list file to build a layered product into the kernel. You can use the file to register a static kernel layered product that has been loaded into the system. The file also can be used by the layered product's Software Control Program (SCP), which is called by the setld command. You copy the /usr/sys/conf/.product.list file into the file that is used to extend the kernel configuration files and that has the follow- ing syntax: /usr/sys/conf/NAME.list The NAME variable specifies the system name that also is used in the system configuration file that has the following syntax: /usr/sys/conf/NAME The doconfig command also will copy the /usr/sys/conf/.product.list file. You can use the -c option to load or delete your layered product into a specific NAME.list file as well as the file. This is useful if you want to load your layered product into a specific NAME.list file without requiring the user to either copy the entire file to the NAME.list file or to manually edit the NAME.list file. The kreg command must be invoked from the root (/) directory. The command can be used only for subsets that are loaded by using the setld command. Also, you must be superuser to use the kreg command. FILES
Contains kernel layered product information. Used to extend the kernel configuration files. SEE ALSO
Commands: doconfig(8), setld(8) System Administration kreg(8)
All times are GMT -4. The time now is 05:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy