summaryrefslogtreecommitdiff
path: root/tests/lib/libcurses/chk_gen
blob: 3646f6a9bed91589f169211b88cda65421b2fa05 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh
#
# Simple script that will generate a check file from input pasted
# in, translate the octal \012 to \n and \015 to \r and then printf
# the resulting string.  This allows output from the verbose cursts
# test to be translated into a check file simply.
#
OUT=""
while read -r line
do
	next=`echo $line | sed -e 's/%/%%/g' -e 's/\n//' -e 's/\\015/\\r/g' -e 's/\\012/\\n/g'`
	OUT="${OUT}${next}"
done
OUT=`echo "${OUT}" | sed 's/\n//'`

printf "${OUT}"