![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| nawk-how count the number of occurances of a pattern, when don't know the pattern | cyber111 | Shell Programming and Scripting | 2 | 05-11-2008 04:00 AM |
| Checking for a file in file pattern before deleting it | dsrookie | UNIX for Dummies Questions & Answers | 1 | 05-09-2008 05:29 PM |
| SED Search Pattern and Replace with the Pattern | racbern | Shell Programming and Scripting | 4 | 03-15-2008 05:59 AM |
| Pattern searching pattern in c files | murthybptl | Shell Programming and Scripting | 6 | 11-17-2007 09:15 AM |
| Search file for pattern and grab some lines before pattern | frustrated1 | Shell Programming and Scripting | 2 | 12-22-2005 03:41 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
pattern checking
hi ,
i am having one file which is having the contents like this : "1111111111" "2222222222" "4444232344" ... i want to check if all the patterns in the file follows this sequence like starting with " ending with " inside that 10 digits... can anyone help me in checking that.. thanks, Krips. |
|
||||
|
Code:
grep -E '^\"[[:digit:]]{10}\"$'
example: Code:
# cat aaa | grep -E '^\"[[:digit:]]{10}\"$'
"1111111111"
"2222222222"
"4444232344"
# cat >bbb
"1111111111"
"2222222222"
"4444232d33"
"f666666666"
"6455"
# cat bbb | grep -E '^\"[[:digit:]]{10}\"$'
"1111111111"
"2222222222"
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|