aboutsummaryrefslogblamecommitdiff
path: root/bin/rfct.awk
blob: 230ac42cf1aa1a05c66bfd48b582a289d889a6be (plain) (tree)
1
2
3
4
5
6
7
8
                                                   

                         



                
 


                                                                           
 



                                                               
          
# Format an RFC in text format for terminal reading

# A record is a paragraph
BEGIN {
    RS = ""
    ORS = "\n\n"
}

# Skip paragraphs with ^L chars in them, as they likely contain headers and
# footers
/\f/ { next }

# Strip out other control characters, but allow newline and tab
{ gsub(/[\a\b\r\v]/, "") }

# If there's anything left after tha, print it
length($0)