Sponsored Content
Special Forums UNIX Desktop Questions & Answers egrep query....request for help Post 302425654 by pseudocoder on Friday 28th of May 2010 08:12:47 PM
Old 05-28-2010
Strange, after some more research, it looks like I initially was right with AND/OR... Finally I'll stick by my initial definition.

A pipe in the egrep pattern stands for a delimiter. A double pipe stands for OR.
However egrep will in both cases print the matching line (which contains both patterns).
Let me illustrate this:
Code:
$ egrep --color=always '(Jolly)|(Brewers)' public
Jolly Brewers
$ egrep --color=always '(Jolly)||(Brewers)' public
Jolly Brewers
$

--colour[=WHEN], --color[=WHEN]
Surround the matching string with the marker find in GREP_COLOR
environment variable. WHEN may be `never', `always', or `auto'
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

HTTP Query Request & Parsing returned XML output

I have a PERL script from which I need to make a HTTP request to Web Servlet (Essentially a URL with variables and values like &Variable1=AAAAAA&Variable2=BBBBBBBBB&Variable3=CCCCCCC). The Web servlet returns an XML result which needs to be parsed for the contents of the result within the program.... (15 Replies)
Discussion started by: jerardfjay
15 Replies

2. Shell Programming and Scripting

egrep help

How can i make something like if (echo "$arg2" | egrep -s '^+\.+km/h+$|^+km/h+$'); then not to output the value of $arg2 on the screen, evertime i get match it outputs the value of the variable on the screen which i don't need to do. I know for grep its -q option but it doesn't work for egrep.... (2 Replies)
Discussion started by: Vozx
2 Replies

3. UNIX for Dummies Questions & Answers

Egrep cheat sheet anywhere? Looking for meaning of egrep -c

Hi I've been searching google and have not found what egrep -c means. Does anyone know where I can get a cheat sheet or what that -c means? thanks, Linda (2 Replies)
Discussion started by: leelm
2 Replies

4. UNIX for Dummies Questions & Answers

search ")" with egrep - egrep: syntax error

Hi Guys, we have a shell script which basically query the Database which retrieves huge data and use the data with "egrep" . Now there is some data which contains characters like "abc)" and the same is used like below : "egrep (.+\|GDPRAB16\|GDPR/11702 96 abc)\|$ temp.txt" now while... (7 Replies)
Discussion started by: sagarjani
7 Replies

5. Shell Programming and Scripting

add the output of a query to a variable to be used in another query

I would like to use the result of a query in another query. How do I redirect/add the output to another variable? $result = odbc_exec($connect, $query); while ($row = odbc_fetch_array($result)) { echo $row,"\n"; } odbc_close($connect); ?> This will output hostnames: host1... (0 Replies)
Discussion started by: hazno
0 Replies

6. Shell Programming and Scripting

Query Oracle tables and return values to shell script that calls the query

Hi, I have a requirement as below which needs to be done viz UNIX shell script (1) I have to connect to an Oracle database (2) Exexute "SELECT field_status from table 1" query on one of the tables. (3) Based on the result that I get from point (2), I have to update another table in the... (6 Replies)
Discussion started by: balaeswari
6 Replies

7. Shell Programming and Scripting

Query regarding egrep command

Hi All, I am having a query regarding the usage of egrep command. i am having two unix environmanets in environment when i am using "egrep -f" it is working fine and other unix environment i am getting a syntax error. Please let me know if i need to set any environmane variables. ... (12 Replies)
Discussion started by: Sriram.Vedula53
12 Replies

8. Shell Programming and Scripting

Shell Script to execute Oracle query taking input from a file to form query

Hi, I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database. For instance: USER CITY --------- ---------- A CITY_A B CITY_B C ... (2 Replies)
Discussion started by: DevendraG
2 Replies

9. Shell Programming and Scripting

Request: How to Parse dynamic SQL query to pad extra columns to match the fixed number of columns

Hello All, I have a requirement in which i will be given a sql query as input in a file with dynamic number of columns. For example some times i will get 5 columns, some times 8 columns etc up to 20 columns. So my requirement is to generate a output query which will have 20 columns all the... (7 Replies)
Discussion started by: vikas_trl
7 Replies
wsreg_query_set_location(3WSREG)		    Product Install Registry Library Functions			  wsreg_query_set_location(3WSREG)

NAME
wsreg_query_set_location, wsreg_query_get_location - set or get the location of a query SYNOPSIS
cc [flag ...] file ...-lwsreg [library ...] #include <wsreg.h> int wsreg_query_set_location(Wsreg_query *query, const char *location); char *wsreg_query_get_location(Wsreg_query *query); DESCRIPTION
The wsreg_query_set_location() function sets the location specified by location in the query specified by query. If a location has already been set in the specified query, the resources associated with the previously set location are released. The wsreg_query_get_location() function gets the location string from the query specified by query. RETURN VALUES
The wsreg_query_set_location() function returns a non-zero value if the location was set correctly; otherwise 0 is returned. The wsreg_query_get_location() function returns the location from the specified query structure. The resulting location string is not a copy, so it must not be released by the caller. USAGE
The query identifies fields used to search for a specific component in the product install registry. By specifying the install location, the component search is narrowed to all components in the product install registry that are installed in the same location. Other fields can be specified in the same query to further narrow the search. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
wsreg_get(3WSREG), wsreg_initialize(3WSREG), wsreg_query_create(3WSREG), attributes(5) SunOS 5.10 22 Sep 2000 wsreg_query_set_location(3WSREG)
All times are GMT -4. The time now is 11:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy