![]() |
|
|
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 |
| how to concatenate values of two variables with an underscore(_) in between | badrimohanty | Shell Programming and Scripting | 8 | 06-16-2009 12:24 PM |
| allow only alphnumeric entry and an underscore | vickylife | Shell Programming and Scripting | 2 | 06-09-2009 10:09 AM |
| usage of underscore in awk | ahmedwaseem2000 | Shell Programming and Scripting | 6 | 12-08-2008 07:18 AM |
| problem with underscore in variable name | pinkie | UNIX for Dummies Questions & Answers | 3 | 04-07-2008 09:27 AM |
| Egrep cheat sheet anywhere? Looking for meaning of egrep -c | leelm | UNIX for Dummies Questions & Answers | 2 | 01-11-2008 03:37 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
egrep string except when preceded by underscore
having trouble with this seemingly simple taks..
![]() Test data: Quote:
-- want to exclude when ${.*schema} is preceded with an underscore; Valid {.*schema} should always be preceded spaces or be found at the beginning of a line. Code:
egrep "[^_][$]{.*schema}\."
|
|
||||
|
Hi editaguy, the OP was trying to match patterns without the preceding underscore. They should also be matched when at the beginning of a line.
|
|
||||
|
Quote:
Then will this work? Code:
sed '/_\${.*schema}/ {/ \${.*schema}/!d;}' file
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|