09-25-2007
i am also struggling with the same one, can some one have look into it. so that it'll be useful ( need solution for bash shell)
thanks,
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi folks,
have a look into the attachment, i am not familiar with unix, can you please help me in this regard.
thanks in advance, :)
regards,
Geeko (4 Replies)
Discussion started by: geeko
4 Replies
2. Shell Programming and Scripting
Hi all,
I am looking for a coomand to search for the keywords in susequenct lines. Keyword1 in a line and Keyword2 in the very next line.
Once i found the combination ineed to print the lines with patterns and the line above and one below.
I am giving an example here: Keywords are :ERROR and... (12 Replies)
Discussion started by: rdhanek
12 Replies
3. Shell Programming and Scripting
I have my data something like this
I need to search for the keyword yyyy in the susequent lines and if it is present, delete the second line with keyword.
In other words, if a keywords is found in two subsequent lines delete the second line.
input data:
aaaa bbbbb cccc dddd
xxxx... (4 Replies)
Discussion started by: rdhanek
4 Replies
4. Shell Programming and Scripting
Hi, I need to grep a pattern and fetch subsequent lines till end of the data-set.
E.g., i have a file like:
AA 1111 23 34
BB 45 56 78
CC 22 44
AA 2222 78 34 56
BB 22 56 67 68 23
CC 56 78
DD 33 55 77
AA 3333 46
BB 58 79
In above file i have 3-data sets where each set starts with... (6 Replies)
Discussion started by: prvnrk
6 Replies
5. Shell Programming and Scripting
I've run into a problem getting exactly what I want out of awk - some folks may recognize this as an output from Amazon's ec2-describe-instances:
Given the following:
INSTANCE i-4960f321
BLOCKDEVICE Line2Var2
TAG instance i-4960f321 Name web1
TAG instance i-4960f321... (2 Replies)
Discussion started by: colinjohnson
2 Replies
6. Shell Programming and Scripting
Hi,
I have got the below requirement. please suggest.
I have a file like,
Processing Item is:
/data/ing/cfg2/abc.txt
/data/ing/cfg3/bgc.txt
Processing Item is:
/data/cmd/for2/ght.txt
/data/kernal/config.klgt.txt
I want to process the above file to get the output file like,
... (5 Replies)
Discussion started by: rbalaj16
5 Replies
7. UNIX for Advanced & Expert Users
Hi,
I have a requirement like, I have a list of pattens in a file say pattern.txt,
PHC111
PHC113
and in another file called master.lst i have entries like,
PHC111
a
b
PHC112
a
PHC113
b
c
PHC114
d
e (5 Replies)
Discussion started by: rbalaj16
5 Replies
8. Shell Programming and Scripting
Hi All,
I have a XML file which is looks like as below. <<please see the attachment >>
<?xml version="1.0" encoding="UTF-8"?>
<esites>
<esite>
<name>XXX.com</name>
<storeId>10001</storeId>
<module>
... (4 Replies)
Discussion started by: Rajeev_hbk
4 Replies
9. UNIX for Beginners Questions & Answers
I have query to replace the first word in line using below code but its replace the middle word too
sed -i 's/load /# LOAD/' /tmp/check.sql
Query 1 :
UPDATE accheadcon_data_last_upload SET last_upload_date = '2017-07-23'
Replace to
UPDATE accheadcon_data_last_up# LOAD SET... (1 Reply)
Discussion started by: kaushik02018
1 Replies
10. UNIX for Beginners Questions & Answers
Input file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies
LEARN ABOUT REDHAT
replace
REPLACE(1) General Commands Manual REPLACE(1)
NAME
replace - A utility program that is used by msql2mysql, but that has more general applicability as well. replace changes strings in place
in files or on the standard input. Uses a finite state machine to match longer strings first. Can be used to swap strings.
USAGE
replace [-?svIV] from to from to ... -- [files]
or
replace [-?svIV] from to from to ... < fromfile > tofile
SYNOPSIS
replace [-?|-I] [-s] [-v]
DESCRIPTION
replace
-?|-I info
-s silent
-v verbose
EXTRA INFO
Special characters in from string:
^ Match start of line.
$ Match end of line.
Match space-character, start of line or end of line. For a end the next replace starts locking at the end space-character. A
alone in a string matches only a space-character.
EXAMPLE
this command swaps a and b in the given files:
shell> replace a b b a -- file1 file2 ...
SEE ALSO
isamchk (1), isamlog (1), mysqlaccess (1), mysqladmin (1), mysqlbug (1), mysqld (1), mysqldump (1), mysqlshow (1), msql2mysql (1), perror
(1), replace (1), safe_mysqld (1), which1 (1), zap (1),
AUTHOR
Ver 1.0, distribution 3.23.29a Michael (Monty) Widenius (monty@tcx.se), TCX Datakonsult AB (http://www.tcx.se). This software comes with
no warranty. Manual page by L. (Kill-9) Pedersen (kill-9@kill-9.dk), Mercurmedia Data Model Architect / system developer (http://www.mer-
curmedia.com)
20 December 2000 REPLACE(1)