File: make-log-test.sh

package info (click to toggle)
libqb 2.0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,092 kB
  • sloc: ansic: 22,191; sh: 5,232; makefile: 607
file content (34 lines) | stat: -rwxr-xr-x 519 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash

line=
count=0
total=50000
echo "#include <stdio.h>"
echo "#include <qb/qblog.h>"
echo "extern void log_dict_words(void);"
echo "void log_dict_words(void) {"

while read  w
do
	if [ $count -eq 0 ]
	then
		line="    qb_log(LOG_DEBUG, \"%d : %s %s %s\", $total"
	fi
	line="$line, \"$w\""
	let count="$count+1"
	if [ $count -eq 3 ]
	then
		line="$line );"
		count=0
		let total="$total-1"
		echo $line
		if [ $total -eq 0 ]
		then
			echo "}"
			exit 0
		fi
	fi
done < /usr/share/dict/words

echo "}"