{ ################################################################### # Gestione Commenti sulla stessa linea che interamente sulla linea ################################################################### if ( Commento != 1 && $0 ~ /\/\*/ && $0 ~ /\*\//) { # stampa il codice prima del commento print (substr($0, 1, index($0,"/*") -1 ) ) # stampa il codice dopo il commento print (substr($0, index($0,"*/") +2, length )) # passa alla prossima linea in input next } ################################## # Gestione Commenti su piu linee ################################## if ( $0 ~ /\/\*/) { if (Commento != 1) #se non sono gia' in un commento print (substr($0, 1, index($0,"/*") -1 ) ) Commento = 1 next } # Se sono internamente ad un commento non stampo nulla if (Commento == 1) { if ( $0 ~ /\*\//) { Commento = 0 # stampa il codice dopo il commento print (substr($0, index($0,"*/") +2, length )) } next } print $0 }