aboutsummaryrefslogblamecommitdiff
path: root/bin/rfct.awk
blob: 3d942b580cf61e8ed8b3aaa9598effba994aec7d (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 that, print it
length($0)