3 # by Stewart Ravenhall <stewart.ravenhall@ukonline.co.uk> -- 4 October 2000
4 # Un-Korn-ized by Paolo Bonzini <bonzini@gnu.org> -- 24 November 2000
6 # Strip everything between /* and */ inclusive
8 # Copes with multi-line comments,
9 # disassociated end comment symbols,
10 # disassociated start comment symbols,
11 # multiple comments per line
13 # Check given file exists
14 program
=`echo $0|sed -e 's:.*/::'`
15 if [ "$#" != 3 ] && [ "$1" != "-" ] && [ ! -f "$1" ]; then
16 print
"$program: $1 does not exist"
20 # Create shell variables for ASCII 1 (control-a)
21 # and ASCII 2 (control-b)
22 a
="`echo | tr '\012' '\001'`"
23 b
="`echo | tr '\012' '\002'`"
25 # The script is updated to strip both c and html comments
26 # The original was taken here: http://sed.sourceforge.net/grabbag/scripts/remccoms2.sh.txt
27 if [ $2 = "c" ] ; then
42 # If no start comment then go to end of script
52 # If not last line then read in next one
58 # If last line then remove from start
59 # comment to end of line
60 # then go to end of script