#!/usr/bin/sed -f # Strip comments from C source. # Carlos J.Duarte # if no /* get next /\/\*/!b # here we've got an /*, append lines until get the corresponding # */ :x /\*\//!{ N bx } # delete /*...*/ s/\/\*.*\*\/// :t /^$/d