Solutions to HW 5 ------------------ 1. Here's a gawk script. It does not handle multiple comments on a given line. BEGIN { incomment = 0 } /^\/\// { print "" next } /\/\// { gsub(/\/\/.*/,"",$0) print next } incomment == 1 { if (gsub(/.*\*\//,"",$0)) { incomment = 0 print } else { print "" } next } incomment == 0 { gsub(/\/\*.*\*\//,"",$0) if (gsub(/\/\*.*/,"",$0)) { incomment = 1 } print }