K2LL33D SHELL

 Apache/2.4.7 (Ubuntu)
 Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64
 uid=33(www-data) gid=33(www-data) groups=33(www-data)
 safemode : OFF
 MySQL: ON | Perl: ON | cURL: OFF | WGet: ON
  >  / usr / share / doc / mawk / examples /
server ip : 172.67.156.115

your ip : 172.69.130.140

H O M E


Filename/usr/share/doc/mawk/examples/nocomment.awk
Size590
Permissionrw-r--r--
Ownerroot : root
Create time27-Apr-2025 09:50
Last modified24-Mar-2014 17:53
Last accessed07-Jul-2025 12:42
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
#!/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 }