pattern matching 
Author Message
 pattern matching

Hi,

Hope someone can help, if I try to match the pattern bellow in awk it
doesn't
work, if I remove the last three characters(t07) it works. Is there a
maximum length to a pattern?

ps -ef | awk '  /\/usr\/X11R6\/bin\/X :0 vt07/ { printf("Process found") } '

Thanks in advance Graham



Sun, 10 Aug 2003 20:00:20 GMT  
 pattern matching

Quote:

>Hi,

>Hope someone can help, if I try to match the pattern bellow in awk it
>doesn't
>work, if I remove the last three characters(t07) it works. Is there a
>maximum length to a pattern?

>ps -ef | awk '  /\/usr\/X11R6\/bin\/X :0 vt07/ { printf("Process found") }
'

Are you sure whether the next to last character is a zero or the letter O?
The expression should not be too long for awk, but ps has limits.
Are you sure that it outputs the entire string including "vt07"?  You
might have to use "ps -efw".


Mon, 11 Aug 2003 16:41:55 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. iss-matching - the free Regular Expression / Pattern Matching cluster

2. pattern match and remove...

3. awk pattern matching?

4. text manipulation and pattern match

5. Pattern match and string insertion between two files

6. Pattern Matching

7. Case-insensitive pattern matching for HTML processing

8. Pattern matching problems

9. problems pattern matching a variable

10. pattern match and extract data

11. last field of array/case insensitive pattern matching query

12. how to use a shell variable in awk for pattern matching

 

 
Powered by phpBB® Forum Software