File: mktxt

package info (click to toggle)
mysql%2B%2B 3.1.0-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 11,640 kB
  • sloc: cpp: 35,569; sh: 3,113; makefile: 946; perl: 786
file content (19 lines) | stat: -rwxr-xr-x 617 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
# Script to convert C++ source files to a text format, with 4 spaces for
# every tab, and with the leading block comment removed.  Used to
# reformat the example programs so they can be xincluded directly into
# the DocBook during XSLT processing.

TXTFILE=$1
SRCFILE=`echo ../../examples/$TXTFILE | sed -e s/\\\\.txt/.cpp/`
if [ ! -e $SRCFILE ]
then
	SRCFILE=`echo ../../examples/$TXTFILE | sed -e s/\\\\.txt/.h/`
fi
CLINE=`grep -n '\*\*/' $SRCFILE |cut -f1 -d:`
LINE=`echo $CLINE + 2 |bc`

#echo Converting $SRCFILE to $TXTFILE, starting at line $LINE...

expand -t4 $SRCFILE | tail -n +$LINE > $TXTFILE