Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • when cutting-n-pasting your awk script into my environment I'm getting syntax errors; please verify your code and update the question accordingly Commented Jan 15 at 17:06
  • So you would like to extract CN=whatever.com,O=XYZ,L=Toronto,ST=Ontario,C=CA and whatever.com from the subject line? Is that it? Commented Jan 15 at 17:08
  • instead of using field numbers to describe which data you wish to display, reference the actual strings from the input; we can't tell if your understanding of field numbers is the same as our understanding of field numbers; also, have you verified RSTART contains what you think it does? also, please clearly state which of your output lines is the expected/desired result Commented Jan 15 at 17:09
  • 1
    Do you absolutely need the BEGIN {F=" "; FS = "\n"; RS = ""; OFS = "\n"} configuration for purposes not shown here, or is this the complete problem statement? Commented Jan 15 at 17:21
  • 1
    Regarding "would it be possible if line 18 contains..." - are you looking for a script that does something with the 18th input line or the line that starts with subject-alternative-name which just happens to be line 18 in your example, or the line following the line that starts with subject "CN..." or something else? Actually - same for "line 17" vs "staring with subject". Please edit your question to clarify how you want the lines target to be identified. Commented Jan 18 at 14:04