Explanation around "+r" in egrep


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
# 1  
Explanation around "+r" in egrep

Hi,

Is anyone able to shed some light on "+r"?

I know -r in grep refers to a recursive search - I am curious to know what +r specifies.

Code:
#show process pidin | utility egrep -e "[0-9]+r" count
2492

Thanks.
# 2  
r -> just a char.
[0-9]+ -> extended regular expression matching number.

Can you show output of show process pidin, so we can see output before greping.

Regards
Peasant
# 3  
Response to Peasant

Hi Peasant,

Here's the original output.
So I take this to mean match lines containing one or more numbers followed by the character r?

Code:
#show processes pidin
Mon Jun 17 09:16:27.826 EDT
     pid tid name               prio STATE       Blocked
       1   1 /procnto-smp-instr   0f RUNNING
       1   2 /procnto-smp-instr   0f RUNNING
       1   3 /procnto-smp-instr   0f RUNNING
       1   4 /procnto-smp-instr   0f READY
       1   5 /procnto-smp-instr  10r RUNNING
       1   6 /procnto-smp-instr  10r RECEIVE     1
       1   7 /procnto-smp-instr  10r RECEIVE     1
       1   8 /procnto-smp-instr  10r RECEIVE     1
       1  10 /procnto-smp-instr  10r RECEIVE     1
       1  11 /procnto-smp-instr  10r RECEIVE     1
       1  13 /procnto-smp-instr  10r RECEIVE     1
       1  16 /procnto-smp-instr  10r RECEIVE     1
       1  17 /procnto-smp-instr  10r RECEIVE     1
       1  18 /procnto-smp-instr  10r RECEIVE     1
       1  30 /procnto-smp-instr  10r RECEIVE     1
    8195   1 sbin/dllmgr         10r RECEIVE     4
    8195   2 sbin/dllmgr         10r NANOSLEEP
    8195   3 sbin/dllmgr         10r RECEIVE     1
    8195   4 sbin/dllmgr         10r RECEIVE     4
    8195   5 sbin/dllmgr         10r RECEIVE     4
   12290   1 in/wd-critical-mon  10r RECEIVE     1
   12290   2 in/wd-critical-mon  63r NANOSLEEP
   12290   3 in/wd-critical-mon  11r NANOSLEEP
   12290   4 in/wd-critical-mon  11r NANOSLEEP
   12290   5 in/wd-critical-mon  11r NANOSLEEP
   12290   6 in/wd-critical-mon  11r NANOSLEEP
   12290   7 in/wd-critical-mon  10r NANOSLEEP
   12290   8 in/wd-critical-mon  10r NANOSLEEP
   12290   9 in/wd-critical-mon  10r NANOSLEEP
   12290  10 in/wd-critical-mon  10r NANOSLEEP
   12295   1 pkg/bin/pkgfs       10r RECEIVE     1
   12295   2 pkg/bin/pkgfs       10r SIGWAITINFO
   12295   3 pkg/bin/pkgfs       10r RECEIVE     1
   12295   4 pkg/bin/pkgfs       10r RECEIVE     1
   12295   5 pkg/bin/pkgfs       10r RECEIVE     1
   12296   1 g/bin/devc-ser8250  10r RECEIVE     1
   12297   1 pkg/bin/devc-pty    10r RECEIVE     1
   12298   1 kg/bin/devc-conaux  16r RECEIVE     1
   12298   2 kg/bin/devc-conaux  16r SIGWAITINFO
   12298   3 kg/bin/devc-conaux  16r RECEIVE     5
   12298   4 kg/bin/devc-conaux  16r SEM         79ddc7c4
   12298   5 kg/bin/devc-conaux  21r INTR

# 4  
Yes
Quote:
Originally Posted by sand1234
Hi Peasant,

Here's the original output.
So I take this to mean match lines containing one or more numbers followed by the character r?

...
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

3. UNIX for Dummies Questions & Answers

Egrep confusion with "I" and "-I" pattern

I am executing following command egrep -w I filename.txt the filename.txt has following data .... -I 07-18 08:31:19.924 9880 6 SessionManager ConnectConfig: ConfigurationWebService LoginResults=SuccessfulLogin I am so hungry that I need to eat I expect egrep to print only the second... (1 Reply)
Discussion started by: VBG
1 Replies

4. UNIX for Dummies Questions & Answers

Explanation on problem "match" function awk

Hello Unix experts, If I could get any explanations on why the code below doesn't work it would be great ! My input looks like that ("|" delimited): Saaaaabbbbbccccc|ok Sdddddfffffggggg|ok The goal is, if $2 is "ok", to remove everything before the pattern given in the match function... (5 Replies)
Discussion started by: lucasvs
5 Replies

5. Shell Programming and Scripting

Escaping backslash and asterisk in egrep to match "\*"

So far what i've got is egrep '^(\\)\*$'No luck. I've searched the web and not much luck. I know about the escape character \ but its confusing to figure out how to use it to match a backslash and use it to escape the asterisk also. Any ides? Thanks! (8 Replies)
Discussion started by: matthewfs
8 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. UNIX for Dummies Questions & Answers

Explanation of "total" field in "ls -l" command output

When I do a listing in one particular directory (ls -al) I get: total 43456 drwxrwxrwx 2 root root 4096 drwxrwxrwx 3 root root 4096 -rwxrwxr-x 1 nobody nobody 3701594 -rwxrwxr-x 1 nobody nobody 3108510 -rwxrwxr-x 1 nobody nobody 3070580 -rwxrwxr-x 1 nobody nobody 3099733 -rwxrwxr-x 1... (1 Reply)
Discussion started by: proactiveaditya
1 Replies

8. UNIX for Dummies Questions & Answers

How to use the "grep/egrep" command to search files.

Hi Team, I am new to this forum and also trying to learn Unix. I will highly appriciate your help if you can help me to get the right command . {{{ I use the command " today | egrep '(10:| 11: )' | grep ERROR " to grep all the files that has been error betweeen 10 to 11... (6 Replies)
Discussion started by: rkhanal
6 Replies

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

10. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

Featured Tech Videos