PHP 8.5.2
Preview: eatc.awk Size: 635 B
//usr/share/doc/mawk/examples/eatc.awk

#!/usr/bin/mawk -f
# $MawkId: eatc.awk,v 1.3 2020/09/19 11:51:23 tom Exp $
#  eatc.awk
#  another program to remove comments

{  while( ( t = index($0 , "/*") ) > 0 )
   {
     if ( t > 1 )
       printf "%s" , substr($0,1,t-1)
     $0 = eat_comment( ( t + 2 <= length($0) ) ? substr($0, t+2) : "" )
   }

   print
}


function eat_comment(s,		t2)
{
  #replace comment by one space
  printf " "

  while ( (t2 = index(s, "*/")) == 0 )
	if ( getline s == 0 )
	{ # input error -- unterminated comment
          system("/bin/sh -c 'echo unterminated comment' 1>&2")
	  exit 1
	}

  return  ( t2 + 2 <= length(s) ) ? substr(s,t2+2) : ""
}

Directory Contents

Dirs: 0 × Files: 10

Name Size Perms Modified Actions
472 B lrwxr-xr-x 2020-09-19 14:49:10
Edit Download
3.19 KB lrwxr-xr-x 2020-09-19 13:46:31
Edit Download
1.82 KB lrwxr-xr-x 2023-10-31 22:58:49
Edit Download
635 B lrwxr-xr-x 2020-09-19 11:51:23
Edit Download
2.88 KB lrwxr-xr-x 2020-09-19 14:04:25
Edit Download
13.97 KB lrwxr-xr-x 2020-09-24 22:05:19
Edit Download
2.89 KB lrwxr-xr-x 2009-08-21 00:36:34
Edit Download
654 B lrwxr-xr-x 2020-09-19 13:02:14
Edit Download
1.03 KB lrwxr-xr-x 2008-09-09 20:52:55
Edit Download
1.11 KB lrwxr-xr-x 2020-09-19 14:20:45
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).