#!/usr/bin/mawk -f # remove C comments from a list of files # using a comment as the record separator # # this is trickier than I first thought # The first version in .97-.9993 was wrong BEGIN { # RS is set to a comment (this is mildly tricky, I blew it here RS = "/\*([^*]|\*+[^*/])*\*+/" ORS = " " getline hold filename = FILENAME } # if changing files filename != FILENAME { filename = FILENAME printf "%s" , hold hold = $0 next } { # hold one record because we don't want ORS on the last # record in each file print hold hold = $0 } END { printf "%s", hold }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
ct_length.awk | File | 407 B | 0755 |
|
decl.awk | File | 2.97 KB | 0755 |
|
deps.awk | File | 1.28 KB | 0755 |
|
eatc.awk | File | 492 B | 0755 |
|
gdecl.awk | File | 2.73 KB | 0755 |
|
hcal | File | 13.72 KB | 0755 |
|
hical | File | 2.89 KB | 0755 |
|
nocomment.awk | File | 590 B | 0755 |
|
primes.awk | File | 1.03 KB | 0755 |
|
qsort.awk | File | 1.07 KB | 0755 |
|