Sponsored Content
Full Discussion: Grep issue
Top Forums Shell Programming and Scripting Grep issue Post 302590701 by jayan_jay on Tuesday 17th of January 2012 07:28:09 AM
Old 01-17-2012
It will be having 2 values bcoz your infile has two lines of prmAttunityUser..
Code:
$ ret=$(grep "^\$prmAttunityUser=" infile | sed 's/\$//g')
$ echo $ret
prmAttunityUser=ais prmAttunityUser=ais

One more ..
Code:
$ ret=$(nawk '/\$prmAttunityUser=/{sub(/\$/,"");print}' infile)
$ echo $ret
prmAttunityUser=ais prmAttunityUser=ais


Last edited by jayan_jay; 01-17-2012 at 08:36 AM.. Reason: typo error...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

issue with grep

using grep, i have a file emp.lst, and i want all those records where "S" or "s" (capital or small) is not there i used this grep emp.lst when i use grep emp.lst i am getting rows with S..but why negate (^) is not working? (3 Replies)
Discussion started by: soujanya_srk
3 Replies

2. UNIX for Dummies Questions & Answers

Issue with grep

I have a file that has the following: 591066 100.0 591066 100.0 591066 100.0 591066 100.0 591066 100.0 591066 100.0 591066 100.0 591066 100.0 591066 100.0 591066 100.0 591066 100.0 ... (5 Replies)
Discussion started by: Pablo_beezo
5 Replies

3. Shell Programming and Scripting

Grep Issue

<record> <set> <termId>1234</termId> <termType>First</termType> </set> <set> <termId>5678</termId> <termType>Second</termType> </set> </record> This is saved in record.xml Hi I have this sample XML that i am grepping using a shell program. The objective of the task is - based... (7 Replies)
Discussion started by: revertback
7 Replies

4. Shell Programming and Scripting

grep issue

The below command is not working stackmem="$(pmap $1 | grep -i '' | awk '{print $2}'| tr -d ' K')" I need to grep strictly for ----> Regards, Mohtashim (2 Replies)
Discussion started by: mohtashims
2 Replies

5. UNIX for Dummies Questions & Answers

Grep issue

more Hello.txt it was a sunny way and i was about to go home. I need to grep and redirect to a new file all the text between 'sunny' and 'go' string above. Note: There may be multiple lines in between the string i need to grep between. If there are multiple 'go' strings it should grep till... (9 Replies)
Discussion started by: mohtashims
9 Replies

6. Shell Programming and Scripting

Issue in grep

i have following pattern in file s6:s2 s2:s4 s1:s2:s3:s4:s5:s6 s1 . . Now i want to find occurence of each record in file like s6:s2 occurs twice {once in first record and both occur in 3 record as well} so output should be s6:s2 2 s2:s4 2 s1:s2:s3:s4:s5:s6 :1 s1 : 2 ... (7 Replies)
Discussion started by: sharad.40216
7 Replies

7. Shell Programming and Scripting

Grep issue

Hi Guys, I am new to shell scripting. Need help on grep command. I had a file called file.log which contain below statements. 12 Nov 2013 14:12:17,756 INFO security - Userid: raja, Saved File Instance, Name: , Registry: 23 Nov 2013 14:14:11,777 INFO security - Userid: raja, Saved... (7 Replies)
Discussion started by: Vinoth Kumar G
7 Replies

8. UNIX for Dummies Questions & Answers

Grep issue

HI, I have a command to check a license file. License_print. In that file you get the headlines and all different licenses. Now i want to have things extracted from it. so i do like following: license_print | grep -iw -e "user" -e "admin" But i donīt want all lines where user is... (11 Replies)
Discussion started by: Tzwaj
11 Replies

9. Shell Programming and Scripting

Issue with grep

Hello, I have an input file that looks like so: LDLR LDLRAD4 VLDLR when I grep "LDLR" I get an output of: LDLR LDLRAD4 VLDLR Since all names have "LDLR" included within them, but all I want the output to be is LDLR I know it can work if I surround the words with pipes for... (5 Replies)
Discussion started by: Rabu
5 Replies

10. UNIX for Dummies Questions & Answers

Issue with Grep

Hi guys, Hope someone can help me with this - I'm sure it's fairly simple but it's driving me mad! (forgive the coding - still new on scripting - come from Windows) I have the following coding for checking whether I want to include a line in a file:- EXTRACT_Date=$(date --date="${PERIOD}"... (6 Replies)
Discussion started by: NickF
6 Replies
PAPI_get_multiplex(3)						       PAPI						     PAPI_get_multiplex(3)

NAME
PAPI_get_multiplex - Get the multiplexing status of specified event set. SYNOPSIS
Detailed Description C Interface: #include <papi.h> int PAPI_get_multiplex( int EventSet ); Fortran Interface: #include fpapi.h PAPIF_get_multiplex( C_INT EventSet, C_INT check ) Parameters: EventSet an integer handle for a PAPI event set as created by PAPI_create_eventset Return values: PAPI_OK PAPI_EINVAL One or more of the arguments is invalid, or the EventSet is already multiplexed. PAPI_ENOEVST The EventSet specified does not exist. PAPI_EISRUN The EventSet is currently counting events. PAPI_ENOMEM Insufficient memory to complete the operation. PAPI_get_multiplex tests the state of the PAPI_MULTIPLEXING flag in the specified event set, returning TRUE if a PAPI event set is multiplexed, or FALSE if not. Example: * int EventSet = PAPI_NULL; * int ret; * * // Create an empty EventSet * ret = PAPI_create_eventset(&EventSet); * if (ret != PAPI_OK) handle_error(ret); * * // Bind it to the CPU component * ret = PAPI_assign_eventset_component(EventSet, 0); * if (ret != PAPI_OK) handle_error(ret); * * // Check current multiplex status * ret = PAPI_get_multiplex(EventSet); * if (ret == TRUE) printf("This event set is ready for multiplexing.") * if (ret == FALSE) printf("This event set is not enabled for multiplexing.") * if (ret < 0) handle_error(ret); * * // Turn on multiplexing * ret = PAPI_set_multiplex(EventSet); * if ((ret == PAPI_EINVAL) && (PAPI_get_multiplex(EventSet) == TRUE)) * printf("This event set already has multiplexing enabled0); * else if (ret != PAPI_OK) handle_error(ret); * See Also: PAPI_multiplex_init PAPI_set_opt PAPI_create_eventset Author Generated automatically by Doxygen for PAPI from the source code. Version 5.2.0.0 Tue Jun 17 2014 PAPI_get_multiplex(3)
All times are GMT -4. The time now is 12:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy