Sponsored Content
Top Forums Shell Programming and Scripting Grep mutiple patterns with 'AND' operator Post 302578190 by itkamaraj on Thursday 1st of December 2011 04:22:45 AM
Old 12-01-2011
if you always expect the Master en Achats comes first and complet comes second

then you can try

Master en Achats.*complet
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

grep for multiple patterns

I want to get a list of all the files in the current directory that have two patterns. I can do first grep of one pattern and then with the output do the grep of the second pattern. if the output of 1st pattern search results in many files, it is very difficult to do a grep of the 2nd pattern for... (1 Reply)
Discussion started by: tselvanin
1 Replies

2. Shell Programming and Scripting

grep patterns - File

Hi I have 3 patterns for example to be searched. These three patterns are available in file1. The patterns to be searched are in file2. I want to search the pattern of file1 to file2. Can any one help with example? Regards Dhana (1 Reply)
Discussion started by: dhanamurthy
1 Replies

3. UNIX for Dummies Questions & Answers

Searching mutiple word - Tuning grep command

Hi all, I have a log file which is more than 1GB, i need to take count from the log file for two strings. i am using the below command but it take a long time to excetue, i need to tune this. Please help me cat /logs/gcbs/gcbsTrace.log | grep -i "ViewStatementBusinessLogic" | grep -c -i... (8 Replies)
Discussion started by: senthilkumar_ak
8 Replies

4. Shell Programming and Scripting

Grep All lines between 2 different patterns

I need a simple script to get all lines between 2 Patterns, e.g. ............. ............. 114456723: testing Script Alpha Beta 114459234: testing Done ............. ............. It should give all the lines in between 114456723 and 114459234, including these as well. Any... (2 Replies)
Discussion started by: gurpreet470
2 Replies

5. Shell Programming and Scripting

grep or sed patterns

i want to match a pattern * ^Subject:.*<\hello\> for my emails to me that has 'hello' anywhere in the subject. (3 Replies)
Discussion started by: oxoxo
3 Replies

6. Shell Programming and Scripting

grep for multiple patterns

I have a file with many rows. I want to grep for multiple patterns from the file. For eg: XX=123|YY=222|ZZ=566 AA=123|EE=222|GG=566 FF=123|RR=222|GG=566 DD=123|RR=222|GG=566 I want the lines which has both XX and ZZ. I know I can get it like this. grep XX file | grep YY But... (10 Replies)
Discussion started by: tene
10 Replies

7. Shell Programming and Scripting

grep value between two patterns

Hi All, I've been trying solve this with a simple command but not having much luck. I have a file like this: Line 1: random_description 123/alert/high random_description2 356/alert/slow Line 2: random_description3 654/alert/medium Line 3: random_description4 234/alert/critical I'm... (7 Replies)
Discussion started by: joe19
7 Replies

8. UNIX for Dummies Questions & Answers

Grep - various patterns

I have a file with the following text: grep \$ grep \\$ grep \\\$ grep '\$' grep '\'$' grep \\ grep \\\\ grep "\$" grep '"$' grep "$" When I perform these same commands on this file, the result are never what I would expect them to be. Could someone please comment on the results and... (3 Replies)
Discussion started by: uran101
3 Replies

9. Shell Programming and Scripting

Grep patterns

Hi Experts, I have a log file like this.I need to filter the Index name and elapsed time(only created ). 06:36:39 SQL> create index XYZ_F75 on XYZ 06:36:39 2 ("GRP_ID", "_ID") parallel 64 nologging 06:36:39 3 tablespace XARGS_IDX 06:36:39 4 ; Index created. Elapsed:... (2 Replies)
Discussion started by: navsan420
2 Replies

10. Shell Programming and Scripting

How to use grep with multiple patterns?

I am trying to grep a variable with multiple lines with multiple patterns below is the pattern list in a variable called "grouplst", each pattern is speerated by "|" grouplst="example1|example2|example3|example4|example5|example6|example7" I need to use the patterns above to grep a... (2 Replies)
Discussion started by: ajetangay
2 Replies
SSAAgentIsAlive(3SNMP)					      SNMP Library Functions					    SSAAgentIsAlive(3SNMP)

NAME
SSAAgentIsAlive, SSAGetTrapPort, SSARegSubtable, SSARegSubagent, SSARegSubtree, SSASendTrap, SSASubagentOpen - Sun Solstice Enterprise Agent registration and communication helper functions SYNOPSIS
cc [ flag ... ] file ... -lssagent -lssasnmp [ library .. ] #include <impl.h> extern int SSAAgentIsAlive(IPAddress *agent_addr, int *port, char *community, struct timeval *timeout); extern int SSAGetTrapPort(); extern int *SSARegSubagent(Agent* agent); int SSARegSubtable(SSA_Table *table); int SSARegSubtree(SSA_Subtree *subtree); extern void SSASendTrap(char *name); extern int SSASubagentOpen(int *num_of_retry, char *agent_name); DESCRIPTION
The SSAAgentIsAlive() function returns TRUE if the master agent is alive, otherwise returns FALSE. The agent_addr parameter is the address of the agent. Specify the security token in the community parameter. You can specify the maximum amount of time to wait for a response with the timeout parameter. The SSAGetTrapPort() function returns the port number used by the Master Agent to communicate with the subagent. The SSARegSubagent() function enables a subagent to register and unregister with a Master Agent. The agent parameter is a pointer to an Agent structure containing the following members: int timeout; /* optional */ int agent_id; /* required */ int agent_status; /* required */ char *personal_file; /* optional */ char *config_file; /* optional */ char *executable; /* optional */ char *version_string; /* optional */ char *protocol; /* optional */ int process_id; /* optional */ char *name; /* optional */ int system_up_time; /* optional */ int watch_dog_time; /* optional */ Address address; /* required */ struct _Agent; /* reserved */ struct _Subtree; /* reserved */ The agent_id member is an integer value returned by the SSASubagentOpen() function. After calling SSASubagentOpen(), you pass the agent_id in the SSARegSubagent() call to register the subagent with the Master Agent. The following values are supported for agent_status: SSA_OPER_STATUS_ACTIVE SSA_OPER_STATUS_NOT_IN_SERVICE SSA_OPER_STATUS_DESTROY You pass SSA_OPER_STATUS_DESTROY as the value in a SSARegSubagent() function call when you want to unregister the agent from the Master Agent. Address has the same structure as sockaddr_in, that is a common UNIX structure containing the following members: short sin_family; ushort_t sin_port; struct in_addr sin_addr; char sin_zero[8]; The SSARegSubtable() function registers a MIB table with the Master Agent. If this function is successful, an index number is returned, otherwise 0 is returned. The table parameter is a pointer to a SSA_Table structure containing the following members: int regTblIndex; /* index value */ int regTblAgentID; /* current agent ID */ Oid regTblOID; /* Object ID of the table */ int regTblStartColumn; /* start column index */ int regTblEndColumn; /* end column index */ int regTblStartRow; /* start row index */ int regTblEndRow; /* end row index */ int regTblStatus; /* status */ The regTblStatus can have one of the following values: SSA_OPER_STATUS_ACTIVE SSA_OPER_STATUS_NOT_IN_SERVICE The SSARegSubtree() function registers a MIB subtree with the master agent. If successful this function returns an index number, otherwise 0 is returned. The subtree parameter is a pointer to a SSA_Subtree structure containing the following members: int regTreeIndex; /* index value */ int regTreeAgentID; /* current agent ID */ Oid name; /* Object ID to register */ int regtreeStatus; /* status */ The regtreeStatus can have one of the following values: SSA_OPER_STATUS_ACTIVE SSA_OPER_STATUS_NOT_IN_SERVICE The SSASendTrap() function instructs the Master Agent to send a trap notification, based on the keyword passed with name. When your sub- agent MIB is compiled by mibcodegen, it creates a lookup table of the trap notifications defined in the MIB. By passing the name of the trap notification type as name, the subagent instructs the Master Agent to construct the type of trap defined in the MIB. The SSASubagentOpen() function initializes communication between the subagent and the Master Agent. You must call this function before calling SSARegSubagent() to register the subagent with the Master Agent. The SSASubagentOpen() function returns a unique agent ID that is passed in the SSARegSubagent() call to register the subagent. If 0 is returned as the agent ID, the attempt to initialize communication with the Master Agent was unsuccessful. Since UDP is used to initialize communication with the Master Agent, you may want to set the value of num_of_retry to make multiple attempts. The value for agent_name must be unique within the domain for which the Master Agent is responsible. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
attributes(5) SunOS 5.10 17 Dec 1996 SSAAgentIsAlive(3SNMP)
All times are GMT -4. The time now is 08:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy