Sponsored Content
Top Forums Shell Programming and Scripting grep a pattern and replace a value in it and write to the same file. Post 302352354 by skmdu on Friday 11th of September 2009 05:40:17 AM
Old 09-11-2009
In case new db name is "UNIX",
Are you expecting the output as follows?

DEV_1_SOURCE_DATABASE=server1
DEV_1_SOURCE_AUDIT_DATABASE= server1
DEV_1_TARGET_DATABASE=server4
DEV_1_TARGET_AUDIT_DATABASE=server4

DEV_2_SOURCE_DATABASE=server2
DEV_2_SOURCE_AUDIT_DATABASE= server2
DEV_2_TARGET_DATABASE=UNIX
DEV_2_TARGET_AUDIT_DATABASE=server5

Is this what your expecting?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

help needed .. Unable to write the data to new file after matching the pattern

Hi, i am pretty new to Unix environment ..... Can i get some help from any of you guyz on writing Unix script. my requirement is like reading a csv file, finding a specific pattern in the lines and repalce the string with new string and write it to another file. My file is file ABC123.dat... (3 Replies)
Discussion started by: prashant_jsw
3 Replies

2. Shell Programming and Scripting

How to replace some content of a file and write with a new name

Hi I have a control file which looks like this LOAD DATA INFILE '/home/scott/XXX.dat' PRESERVE BLANKS ............. ............. how can i change the content of this file and replace the file in the second line with anothe file name and write it back with another name to the disk? ... (5 Replies)
Discussion started by: mwrg
5 Replies

3. Shell Programming and Scripting

How to delete a string pattern in a file and write back to the same file

I have a control file which looks like this LOAD DATA INFILE '/array/data/data_Finished_T5_col_change/home/oracle/emp.dat' PRESERVE BLANKS INTO TABLE SCOTT.EMP FIELDS TERMINATED BY '|' OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS (................. ..................) How can i edit the... (1 Reply)
Discussion started by: mwrg
1 Replies

4. Shell Programming and Scripting

Replace a particular pattern in a file

Hi , I have a requirement where i have this file abcd $$xyz=123 $$zef=789 $$mno=123 $$pqr=456 I need to replace $$pqr from 456 to a new value which will be present in a variable to me. I am not aware of sed and awk functionality. Can somebody please show me how to replace this... (6 Replies)
Discussion started by: lifzgud
6 Replies

5. UNIX for Dummies Questions & Answers

Write to file using tail -f through a pipe to grep

Hi -- I'm looking to write to a file after piping output from tail -f through to grep: #write to a file for all lines with "searchtext" within in error_log: Expand|Select|Wrap|Line Numbers tail -f /var/error_log | grep searchtext > output.txt The above command... (2 Replies)
Discussion started by: ndedhia1
2 Replies

6. Shell Programming and Scripting

script to grep a pattern from file compare contents with another file and replace

Hi All, Need help on this I have 2 files one file file1 which has several entries as : define service{ hostgroup_name !host1,!host5,!host6,.* service_description check_nrpe } define service{ hostgroup_name !host2,!host4,!host6,.* service_description check_opt } another... (2 Replies)
Discussion started by: namitai
2 Replies

7. Shell Programming and Scripting

Check for Pattern if exists write to file

Hi ! All I just want to search and write to new file if pattern is found in text file following are my text files by which I want to search Month and last column number my text file1 15-Jan-2011 25 ARTS 1255 125 125 178 198 15-Jan-2011 25 ARTS 1255 125 125 178 198 15-Jan-2011 25... (3 Replies)
Discussion started by: nex_asp
3 Replies

8. Shell Programming and Scripting

Search pattern and write line into another file

Hi, I have a file which contains the below details.. My requirement is to fetch all the lines which are starting with "ABC_XY_" into 1 file and rest of the lines (not starting with "ABC_XY_") into another file. Could you please help with what command needs to be used? file1.txt ----------... (12 Replies)
Discussion started by: satyaatcgi
12 Replies

9. Shell Programming and Scripting

Piping through grep/awk prevents file write

So, this is weird... I'm running this command: iotop -o -P -k -bt -d 5 I'd like to save the output relelvant to rsyslogd to a file, so I do this: iotop -o -P -k -bt -d 5 | grep rsyslogd >> /var/log/rsyslogd Nothing is written to the file! I can write the full output to the file: ... (2 Replies)
Discussion started by: treesloth
2 Replies

10. Shell Programming and Scripting

sed and awk usage to grep a pattern 1 and with reference to this grep a pattern 2 and pattern 3

Hi , I have a file where i have modifed certain things compared to original file . The difference of the original file and modified file is as follows. # diff mir_lex.c.modified mir_lex.c.orig 3209c3209 < if(yy_current_buffer -> yy_is_our_buffer == 0) { --- >... (5 Replies)
Discussion started by: breezevinay
5 Replies
asadmin-create-instance(1AS)											      asadmin-create-instance(1AS)

y"; "User Commands"

NAME
asadmin-create-instance, create-instance - creates an application server instance with the specified instance name SYNOPSIS
create-instance [--user admin_user] [-password admin_password] [--host localhost] [--port 4848] [--sysuser sys_user] [--domain domain_name] [--local=false] [--passwordfile filename] [--secure|-s]--instanceport instanceportinstance_name You can create a new instance on a local or remote machine. If on the remote machine an administration server is already running for the specified hostname, then the system defaults to the local hostname. To create the instance locally, not requiring the administration server to be up and running, specify the --local option. The named instance must not exist within that domain. OPTIONS
--user administrative user associated for the instance. --password administrative password corresponding to the administrative user. --host host name of the machine hosting the administrative instance. --port administrative port number associated with the administrative host. --sysuser owner of the domain directory. --domain name of the domain. --local determines if the command should delegate the request to administrative instance or run locally. --passwordfile file containing passwords appropriate for the command (e.g., administrative instance). --secure if true, uses SSL/TLS to communicate with the administrative instance. --instanceport port where the instance listens for requests. OPERANDS
instance_name name of the instance to be created. Example 1: Using create-instance in local mode asadmin> create-instance --domain domain1 --instanceport 8967 --sysuser adminuser server4 Created Instance server4 successfully Where: the server4 instance is created under the domain1 domain. Example 2: Using create-instance in remote mode asadmin> create-instance --sysuser adminuser --user admin --password adminadmin --host localhost --port 4848 --instanceport 8967 server4 Created Instance server4 successfully Where: the server4 instance is created on the remote server for the associated user, password, host, and port. EXIT STATUS
0 command executed successfully 1 error in executing the command INTERFACE EQUIVALENT
Application Server instances page asadmin-delete-instance(1AS), asadmin-start-instance(1AS), asadmin-stop-instance(1AS), asadmin-restart-instance(1AS) J2EE 1.4 SDK/refmiscinfo> March 2004 asadmin-create-instance(1AS)
All times are GMT -4. The time now is 11:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy