[CentOS] awk global replacement only after keyword
Joseph L. Casale
jcasale at activenetwerx.comFri Mar 26 03:20:06 UTC 2010
- Previous message: [CentOS] awk global replacement only after keyword
- Next message: [CentOS] awk global replacement only after keyword
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>Depends on how you define "one-liner." Something like this might work: > >{ if index($0, PATTERN) != 0 {FOUND = 1;}; if (FOUND != 0) >{subst(REPLACE_THIS, WITH_THIS, $0); } > >You'd want to reverse the order of the two statements if the >replacement is only to occur after the pattern is found. Cool, I'll give it a whirl tomorrow! I do want to replace all occurrences only after the keyword Thanks, jlc
- Previous message: [CentOS] awk global replacement only after keyword
- Next message: [CentOS] awk global replacement only after keyword
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list