I tried that solution :-
It works, but the issue is that the second bag name could be any value, its not specifically "mybag3", so the second pattern must be the more generic "/^bag name=/
So i tried that also :-
it failed because the flag was being reset straight after it was set as the more generic pattern also matched the mybag2 line.
Then I switched the pattern order and BINGO !
Thanks very much for leading me in the right direction kholostoi
Last edited by Yogesh Sawant; 05-27-2010 at 04:50 AM..
Reason: added code tags
Hi!
From a file like this one :
hello
...
PATTERN1
...
lines between patterns
..
PATTERN2
...
I would like to extract only the lines between patterns, probably with awk I think?
Thanks a lot for your help,
Tipi (5 Replies)
Hi,
From the sample file below
Conditions
1) Pattern Range must start with "ALTER TABLE"
2) Pattern Range ends when it finds ";"
3) Between this range i want to select all the patterns that contain pattern " MOVE "
Note : I would like to exclude the above pattern matches and print... (1 Reply)
Hi,
Here is a sample of my Test File
$ cat TestFile1
Prompt Table DQZ_ALTER_SCHEMA_ID;
ALTER TABLE DQZ.DQZ_ALTER_SCHEMA_ID MONITORING;
ALTER TABLE DQZ.DQZ_ALTER_SCHEMA_ID STORAGE ( NEXT 3464K );
Prompt Table DQZ_ALTER_SCHEMA_ID;
ALTER TABLE DQZ.DQZ_ALTER_SCHEMA_ID
MOVE LOB... (16 Replies)
Hi,
I have a file like below:
.
.
.
.
Jack is going home
Jack is going to school
Jack is sleeping
Jack is eating dinner
John is going home
John is eating breakfast
.
.
.
The specific line is:
Jack is going home (2 Replies)
Hi folks,
I have a file which contains several occurences of 2 different patterns. I need to find out the line of first occurence of pattern2 starting after the position of first occurence of pattern1.
example file:
aaaa
pattern2
bbbb
pattern1
ccc
pattern2
ddd
pattern1
eee
pattern2... (9 Replies)
Hi all!
How can I delete all the text starting from <string1> to <string2> in all the .txt files of the folder "FOLDER" ?
Thanks a lot!
mjomba
...
</s>
<s>
<w></w>
</s>
<s>
...
to get: (1 Reply)
Hello, I'm looking for sed solution to change
...
<li>keyword</li>
<li>keyword
<li>keyword</li>
<li>keyword
<li>keyword</li>
...
to
...
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
...
I.e., if lines beginning with <li> do not end with... (3 Replies)
Hi
I need to delete lines from a file which are after pattern1 and between pattern 2 and patter3, as below:
aaaaaaaa
bbbbbbbb
pattern1
cdededed
ddededed
pattern2
fefefefe <-----Delete this line
efefefef <-----Delete this line
pattern3
adsffdsd
huaserew
Please can you suggest... (6 Replies)
not getting anywhere with this
an xml file contains multiple clients set up with same tags, different values.
I need to parse the file for client foo, and change the value of tag "64bit" from false to true.
cat clients.xml
<Client type"FIX">
<ClientName>foo</ClientName>... (3 Replies)
Version: RHEL 6.5
In the below text file, I want to find the lines which has the string JOHN , KATE and STEVE in it.
The logic is to grep with an AND condition ie. get all lines with JOHN AND KATE AND STEVE
$ cat sometext.txt
PHILIP worked in HR
JOHN along with KATE fixed several IT... (4 Replies)
Discussion started by: John K
4 Replies
LEARN ABOUT OPENSOLARIS
ucblinks
ucblinks(1B) SunOS/BSD Compatibility Package Commands ucblinks(1B)NAME
ucblinks - adds /dev entries to give SunOS 4.x compatible names to SunOS 5.x devices
SYNOPSIS
/usr/ucb/ucblinks [-e rulebase] [-r rootdir]
DESCRIPTION
ucblinks creates symbolic links under the /dev directory for devices whose SunOS 5.x names differ from their SunOS 4.x names. Where possi-
ble, these symbolic links point to the device's SunOS 5.x name rather than to the actual /devices entry.
ucblinks does not remove unneeded compatibility links; these must be removed by hand.
ucblinks should be called each time the system is reconfiguration-booted, after any new SunOS 5.x links that are needed have been created,
since the reconfiguration may have resulted in more compatibility names being needed.
In releases prior to SunOS 5.4, ucblinks used a nawk rule-base to construct the SunOS 4.x compatible names. ucblinks no longer uses nawk
for the default operation, although nawk rule-bases can still be specifed with the -e option. The nawk rule-base equivalent to the SunOS
5.4 default operation can be found in /usr/ucblib/ucblinks.awk.
OPTIONS -e rulebase Specify rulebase as the file containing nawk(1) pattern-action statements.
-r rootdir Specify rootdir as the directory under which dev and devices will be found, rather than the standard root directory /.
FILES
/usr/ucblib/ucblinks.awk sample rule-base for compatibility links
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO devlinks(1M), disks(1M), ports(1M), tapes(1M), attributes(5)SunOS 5.11 13 Apr 1994 ucblinks(1B)