Sponsored Content
Top Forums Shell Programming and Scripting The pattern used in awk has brackets! Post 302557755 by sudvishw on Thursday 22nd of September 2011 04:28:03 AM
Old 09-22-2011
The pattern used in awk has brackets!

Hi,
One of the pattern that I use in awk, comes with round brackets; hence awk is not working correctly.

The pattern I am using is 'High water mark (bytes)'. As this pattern has 'bytes' enclosed within brackets, awk is not working...

Code:
lne="High water mark (bytes) = 65536 High water mark (bytes) = 105536"
echo $lne |  awk -F "High water mark (bytes)" '{print $2}'

I tried using backslash to escape the special meaning of '('; but it did not help.

Code:
echo $lne |  awk -F "High water mark \(bytes\)" '{print $2}'

Please hlep.

Thanks in advance,
Sudha.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

print pattern line +2 without tabs or brackets

This works, but its messy. Any suggestions for a elegant solution? :- me@myserver $ head zoneAttachOutfile These packages installed on the source system are inconsistent with this system: SUNWsmbac: version mismatch (11.9.0,REV=2002.03.02.00.35) ... (2 Replies)
Discussion started by: repudi8or
2 Replies

2. Shell Programming and Scripting

Use to awk to match pattern, and print the pattern

Hi, I know how to use awk to search some expressions like five consecutive numbers, , this is easy. However, how do I make awk print the pattern that is been matched? For example: input: usa,canada99292,japan222,france59664,egypt223 output:99292,59664 (6 Replies)
Discussion started by: grossgermany
6 Replies

3. Shell Programming and Scripting

Delete text between square brackets and also delete those square brackets using sed or awk

Hi All, I have a text file which looks like this: computer programming systems engineering I want to get rid of these square brackets and also the text that is inside these brackets. So that my final text file looks like this: computer programming systems engineering I am using... (3 Replies)
Discussion started by: shoaibjameel123
3 Replies

4. Shell Programming and Scripting

AWK match $1 $2 pattern in file 1 to $1 $2 pattern in file2

Hi, I have 2 files that I have modified to basically match each other, however I want to determine what (if any) line in file 1 does not exist in file 2. I need to match column $1 and $2 as a single string in file1 to $1 and $2 in file2 as these two columns create a match. I'm stuck in an AWK... (9 Replies)
Discussion started by: right_coaster
9 Replies

5. Shell Programming and Scripting

Awk to match a pattern and perform a search after the first pattern

Hello Guyz I have been following this forum for a while and the solutions provided are super useful. I currently have a scenario where i need to search for a pattern and start searching by keeping the first pattern as a baseline ABC DEF LMN EFG HIJ LMN OPQ In the above text i need to... (8 Replies)
Discussion started by: RickCharles
8 Replies

6. 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

7. Shell Programming and Scripting

Big pattern file matching within another pattern file in awk or shell

Hi I need to do a patten match between files . I am new to shell scripting and have come up with this so far. It take 50 seconds to process files of 2mb size . I need to tune this code as file size will be around 50mb and need to save time. Main issue is that I need to search the pattern from... (2 Replies)
Discussion started by: nitin_daharwal
2 Replies

8. Shell Programming and Scripting

awk to combine lines from line with pattern match to a line that ends in a pattern

I am trying to combine lines with these conditions: 1. First line starts with text of "libname VALUE db2 datasrc" where VALUE can be any text. 2. If condition1 is met then continue to combine lines through a line that ends with a semicolon. 3. Ignore case when matching patterns and remove any... (5 Replies)
Discussion started by: Wes Kem
5 Replies

9. UNIX for Beginners Questions & Answers

Grep/awk using a begin search pattern and end search pattern

I have this fileA TEST FILE ABC this file contains ABC; TEST FILE DGHT this file contains DGHT; TEST FILE 123 this file contains ABC, this file contains DEF, this file contains XYZ, this file contains KLM ; I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies

10. UNIX for Beginners Questions & Answers

awk to remove pattern and lines above pattern

In the awk below I am trying to remove all lines above and including the pattern Test or Test2. Each block is seperated by a newline and Test2 also appears in the lines to keep but it will always have additional text after it. The Test to remove will not. The awk executed until the || was added... (2 Replies)
Discussion started by: cmccabe
2 Replies
qband(9S)						    Data Structures for Drivers 						 qband(9S)

NAME
qband - STREAMS queue flow control information structure SYNOPSIS
#include <sys/stream.h> INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI) DESCRIPTION
The qband structure contains flow control information for each priority band in a queue. The qband structure is defined as type qband_t. STRUCTURE MEMBERS
struct qband*qb_next; /* next band's info */ size_t qb_count /* number of bytes in band */ struct msgb *qb_first; /* start of band's data */ struct msgb *qb_last; /* end of band's data */ size_t qb_hiwat; /* band's high water mark */ size_t qb_lowat; /* band's low water mark */ uint_t qb_flag; /* see below */ Valid flags are as follows: QB_FULL Band is considered full. QB_WANTW Someone wants to write to band. SEE ALSO
strqget(9F), strqset(9F), msgb(9S), queue(9S) STREAMS Programming Guide NOTES
All access to this structure should be through strqget(9F) and strqset(9F). It is logically part of the queue(9S) and its layout and parti- tioning with respect to that structure might change in future releases. If portability is a concern, do not declare or store instances of or references to this structure. SunOS 5.11 14 Nov 1996 qband(9S)
All times are GMT -4. The time now is 09:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy