Article 5RGGX Patterns in awk and sed

Patterns in awk and sed

by
Faki
from LinuxQuestions.org on (#5RGGX)
Have noticed that a pattern used with awk such as

Code:charcl='^[[:space:]]*([#;!]+|@c|\/\/)[[:space:]]*'
begrec="${charcl}"'Mode: rec$'has to be modified for use with `sed` by escaping the `()`.

Code:charcl='^[[:space:]]*\([#;!]+\|@c\|\/\/\)[[:space:]]*'
begrec="${charcl}"'Mode: rec$'Is this correct? I would like to set the same pattern in `charcl` for use in both `awk` and `sed` commands.latest?d=yIl2AUoC8zA latest?i=B5TE0o4Ik4Y:Pd9zhNMieoY:F7zBnMy latest?i=B5TE0o4Ik4Y:Pd9zhNMieoY:V_sGLiP latest?d=qj6IDK7rITs latest?i=B5TE0o4Ik4Y:Pd9zhNMieoY:gIN9vFwB5TE0o4Ik4Y
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments