11590Srgrimes#!/bin/sh -
21590Srgrimes#
31590Srgrimes# Copyright (c) 1992 Diomidis Spinellis.
41590Srgrimes# Copyright (c) 1992, 1993
51590Srgrimes#	The Regents of the University of California.  All rights reserved.
61590Srgrimes#
71590Srgrimes# Redistribution and use in source and binary forms, with or without
81590Srgrimes# modification, are permitted provided that the following conditions
91590Srgrimes# are met:
101590Srgrimes# 1. Redistributions of source code must retain the above copyright
111590Srgrimes#    notice, this list of conditions and the following disclaimer.
121590Srgrimes# 2. Redistributions in binary form must reproduce the above copyright
131590Srgrimes#    notice, this list of conditions and the following disclaimer in the
141590Srgrimes#    documentation and/or other materials provided with the distribution.
151590Srgrimes# 4. Neither the name of the University nor the names of its contributors
161590Srgrimes#    may be used to endorse or promote products derived from this software
171590Srgrimes#    without specific prior written permission.
181590Srgrimes#
191590Srgrimes# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
201590Srgrimes# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
211590Srgrimes# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
221590Srgrimes# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
231590Srgrimes# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
241590Srgrimes# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
251590Srgrimes# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
261590Srgrimes# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
271590Srgrimes# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
281590Srgrimes# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
291590Srgrimes# SUCH DAMAGE.
301590Srgrimes#
311590Srgrimes#	@(#)sed.test	8.1 (Berkeley) 6/6/93
321590Srgrimes#
33117900Sdds#	$FreeBSD$
34117900Sdds#
351590Srgrimes
361590Srgrimes# sed Regression Tests
371590Srgrimes#
38167552Sdds# The directory regress.test.out contains the expected test results
39167552Sdds#
40197352Sdds# These are the regression tests mostly created during the development
41197352Sdds# of the BSD sed.  Each test should have a unique mark name, which is
42197352Sdds# used for naming the corresponding file in regress.multitest.out.
431590Srgrimes
44263227SjmmvSRCDIR=$(dirname $0)
45263227Sjmmv
461590Srgrimesmain()
471590Srgrimes{
48263227Sjmmv	REGRESS=${SRCDIR}/regress.multitest.out
491590Srgrimes	DICT=/usr/share/dict/words
501590Srgrimes
511590Srgrimes	awk 'END { for (i = 1; i < 15; i++) print "l1_" i}' </dev/null >lines1
521590Srgrimes	awk 'END { for (i = 1; i < 10; i++) print "l2_" i}' </dev/null >lines2
531590Srgrimes
54201490Sobrien	echo "1..129"
55167552Sdds
561590Srgrimes	exec 4>&1 5>&2
57167552Sdds	tests
58167552Sdds	exec 1>&4 2>&5
591590Srgrimes
60167552Sdds	# Remove temporary files
61167552Sdds	rm -f current.out lines[1-4] script[1-2]
621590Srgrimes}
631590Srgrimes
641590Srgrimestests()
651590Srgrimes{
66167552Sdds	SED=sed
67167552Sdds	MARK=0
681590Srgrimes
691590Srgrimes	test_args
701590Srgrimes	test_addr
711590Srgrimes	test_group
721590Srgrimes	test_acid
731590Srgrimes	test_branch
741590Srgrimes	test_pattern
751590Srgrimes	test_print
761590Srgrimes	test_subst
77167555Sdds	test_error
78167552Sdds	# Handle the result of the last test
79167552Sdds	result
801590Srgrimes}
811590Srgrimes
82167552Sdds# Display a test's result
83167552Sddsresult()
84167552Sdds{
85167552Sdds	if [ "$TODO" = '1' ] ; then
86167552Sdds		TODO='TODO '
87167552Sdds	else
88167552Sdds		TODO=''
89167552Sdds	fi
90197352Sdds	if ! [ -r $REGRESS/${TESTNAME} ] ; then
91197352Sdds		echo "Seeding $REGRESS/${TESTNAME} with current result" 1>&2
92197352Sdds		cp current.out $REGRESS/${TESTNAME}
93167555Sdds	fi
94197352Sdds	if diff -c $REGRESS/${TESTNAME} current.out ; then
95167552Sdds		echo "ok $MARK $TESTNAME # $TODO$COMMENT"
96167552Sdds	else
97167552Sdds		echo "not ok $MARK $TESTNAME # $TODO$COMMENT"
98167552Sdds	fi 1>&4 2>&5
99167552Sdds}
100167552Sdds
101167552Sdds# Mark the beginning of each test
1021590Srgrimesmark()
1031590Srgrimes{
104167552Sdds	[ $MARK -gt 0 ] && result
1051590Srgrimes	MARK=`expr $MARK + 1`
106167552Sdds	TESTNAME=$1
1071590Srgrimes	exec 1>&4 2>&5
108167552Sdds	exec >"current.out"
1091590Srgrimes}
1101590Srgrimes
1111590Srgrimestest_args()
1121590Srgrimes{
113167552Sdds	COMMENT='Argument parsing - first type'
1141590Srgrimes	mark '1.1'
115167549Sdds	$SED 's/^/e1_/p' lines1
1161590Srgrimes	mark '1.2' ; $SED -n 's/^/e1_/p' lines1
1171590Srgrimes	mark '1.3'
118167549Sdds	$SED 's/^/e1_/p' <lines1
1191590Srgrimes	mark '1.4' ; $SED -n 's/^/e1_/p' <lines1
120167552Sdds	COMMENT='Argument parsing - second type'
1211590Srgrimes	mark '1.4.1'
1221590Srgrimes	$SED -e '' <lines1
1231590Srgrimes	echo 's/^/s1_/p' >script1
1241590Srgrimes	echo 's/^/s2_/p' >script2
1251590Srgrimes	mark '1.5'
126167549Sdds	$SED -f script1 lines1
1271590Srgrimes	mark '1.6'
128167549Sdds	$SED -f script1 <lines1
1291590Srgrimes	mark '1.7'
130167549Sdds	$SED -e 's/^/e1_/p' lines1
1311590Srgrimes	mark '1.8'
132167549Sdds	$SED -e 's/^/e1_/p' <lines1
1331590Srgrimes	mark '1.9' ; $SED -n -f script1 lines1
1341590Srgrimes	mark '1.10' ; $SED -n -f script1 <lines1
1351590Srgrimes	mark '1.11' ; $SED -n -e 's/^/e1_/p' lines1
1361590Srgrimes	mark '1.12'
137167549Sdds	$SED -n -e 's/^/e1_/p' <lines1
1381590Srgrimes	mark '1.13'
139167549Sdds	$SED -e 's/^/e1_/p' -e 's/^/e2_/p' lines1
1401590Srgrimes	mark '1.14'
141167549Sdds	$SED -f script1 -f script2 lines1
1421590Srgrimes	mark '1.15'
143167552Sdds	$SED -e 's/^/e1_/p' -f script1 lines1
1441590Srgrimes	mark '1.16'
145167549Sdds	$SED -e 's/^/e1_/p' lines1 lines1
1461590Srgrimes	# POSIX D11.2:11251
1471590Srgrimes	mark '1.17' ; $SED p <lines1 lines1
1481590Srgrimescat >script1 <<EOF
1491590Srgrimes#n
1501590Srgrimes# A comment
1511590Srgrimes
1521590Srgrimesp
1531590SrgrimesEOF
1541590Srgrimes	mark '1.18' ; $SED -f script1 <lines1 lines1
1551590Srgrimes}
1561590Srgrimes
1571590Srgrimestest_addr()
1581590Srgrimes{
159167552Sdds	COMMENT='Address ranges'
1601590Srgrimes	mark '2.1' ; $SED -n -e '4p' lines1
1611590Srgrimes	mark '2.2' ; $SED -n -e '20p' lines1 lines2
1621590Srgrimes	mark '2.3' ; $SED -n -e '$p' lines1
1631590Srgrimes	mark '2.4' ; $SED -n -e '$p' lines1 lines2
1641590Srgrimes	mark '2.5' ; $SED -n -e '$a\
1651590Srgrimeshello' /dev/null
1661590Srgrimes	mark '2.6' ; $SED -n -e '$p' lines1 /dev/null lines2
1671590Srgrimes	# Should not print anything
1681590Srgrimes	mark '2.7' ; $SED -n -e '20p' lines1
169167546Sdds	mark '2.8' ; $SED -n -e '/NOTFOUND/p' lines1
1701590Srgrimes	mark '2.9' ; $SED -n '/l1_7/p' lines1
1711590Srgrimes	mark '2.10' ; $SED -n ' /l1_7/ p' lines1
172167544Sdds	mark '2.11' ; $SED -n '\_l1\_7_p' lines1
1731590Srgrimes	mark '2.12' ; $SED -n '1,4p' lines1
1741590Srgrimes	mark '2.13' ; $SED -n '1,$p' lines1 lines2
1751590Srgrimes	mark '2.14' ; $SED -n '1,/l2_9/p' lines1 lines2
1761590Srgrimes	mark '2.15' ; $SED -n '/4/,$p' lines1 lines2
1771590Srgrimes	mark '2.16' ; $SED -n '/4/,20p' lines1 lines2
1781590Srgrimes	mark '2.17' ; $SED -n '/4/,/10/p' lines1 lines2
1791590Srgrimes	mark '2.18' ; $SED -n '/l2_3/,/l1_8/p' lines1 lines2
180167544Sdds	mark '2.19' ; $SED -n '12,3p' lines1 lines2
181167544Sdds	mark '2.20' ; $SED -n '/l1_7/,3p' lines1 lines2
182192733Sbrian	mark '2.21' ; $SED -n '13,+4p' lines1 lines2
183192733Sbrian	mark '2.22' ; $SED -n '/l1_6/,+2p' lines1 lines2
1841590Srgrimes}
1851590Srgrimes
1861590Srgrimestest_group()
1871590Srgrimes{
188167552Sdds	COMMENT='Brace and other grouping'
1891590Srgrimes	mark '3.1' ; $SED -e '
1901590Srgrimes4,12 {
1911590Srgrimes	s/^/^/
1921590Srgrimes	s/$/$/
1931590Srgrimes	s/_/T/
1941590Srgrimes}' lines1
1951590Srgrimes	mark '3.2' ; $SED -e '
1961590Srgrimes4,12 {
1971590Srgrimes	s/^/^/
1981590Srgrimes	/6/,/10/ {
1991590Srgrimes		s/$/$/
2001590Srgrimes		/8/ s/_/T/
2011590Srgrimes	}
2021590Srgrimes}' lines1
2031590Srgrimes	mark '3.3' ; $SED -e '
2041590Srgrimes4,12 !{
2051590Srgrimes	s/^/^/
2061590Srgrimes	/6/,/10/ !{
2071590Srgrimes		s/$/$/
2081590Srgrimes		/8/ !s/_/T/
2091590Srgrimes	}
2101590Srgrimes}' lines1
2111590Srgrimes	mark '3.4' ; $SED -e '4,12!s/^/^/' lines1
2121590Srgrimes}
2131590Srgrimes
2141590Srgrimestest_acid()
2151590Srgrimes{
216167552Sdds	COMMENT='Commands a c d and i'
2171590Srgrimes	mark '4.1' ; $SED -n -e '
2181590Srgrimess/^/before_i/p
2191590Srgrimes20i\
2201590Srgrimesinserted
2211590Srgrimess/^/after_i/p
2221590Srgrimes' lines1 lines2
2231590Srgrimes	mark '4.2' ; $SED -n -e '
2241590Srgrimes5,12s/^/5-12/
2251590Srgrimess/^/before_a/p
2261590Srgrimes/5-12/a\
2271590Srgrimesappended
2281590Srgrimess/^/after_a/p
2291590Srgrimes' lines1 lines2
2301590Srgrimes	mark '4.3'
2311590Srgrimes	$SED -n -e '
2321590Srgrimess/^/^/p
2331590Srgrimes/l1_/a\
2341590Srgrimesappended
2351590Srgrimes8,10N
2361590Srgrimess/$/$/p
2371590Srgrimes' lines1 lines2
2381590Srgrimes	mark '4.4' ; $SED -n -e '
2391590Srgrimesc\
2401590Srgrimeshello
2411590Srgrimes' lines1
2421590Srgrimes	mark '4.5' ; $SED -n -e '
2431590Srgrimes8c\
2441590Srgrimeshello
2451590Srgrimes' lines1
2461590Srgrimes	mark '4.6' ; $SED -n -e '
2471590Srgrimes3,14c\
2481590Srgrimeshello
2491590Srgrimes' lines1
2501590Srgrimes# SunOS and GNU sed behave differently.   We follow POSIX
251167549Sdds	mark '4.7' ; $SED -n -e '
252167549Sdds8,3c\
253167549Sddshello
254167549Sdds' lines1
2551590Srgrimes	mark '4.8' ; $SED d <lines1
2561590Srgrimes}
2571590Srgrimes
2581590Srgrimestest_branch()
2591590Srgrimes{
260167552Sdds	COMMENT='Labels and branching'
2611590Srgrimes	mark '5.1' ; $SED -n -e '
2621590Srgrimesb label4
2631590Srgrimes:label3
2641590Srgrimess/^/label3_/p
2651590Srgrimesb end
2661590Srgrimes:label4
2671590Srgrimes2,12b label1
2681590Srgrimesb label2
2691590Srgrimes:label1
2701590Srgrimess/^/label1_/p
2711590Srgrimesb
2721590Srgrimes:label2
2731590Srgrimess/^/label2_/p
2741590Srgrimesb label3
2751590Srgrimes:end
2761590Srgrimes' lines1
2771590Srgrimes	mark '5.2'
2781590Srgrimes	$SED -n -e '
2791590Srgrimess/l1_/l2_/
2801590Srgrimest ok
2811590Srgrimesb
2821590Srgrimes:ok
2831590Srgrimess/^/tested /p
2841590Srgrimes' lines1 lines2
285168257Syar# SunOS and GNU sed behave as follows: lines 9-$ aren't printed at all
286167549Sdds	mark '5.3' ; $SED -n -e '
287167549Sdds5,8b inside
288167549Sdds1,5 {
289167549Sdds	s/^/^/p
290167549Sdds	:inside
291167549Sdds	s/$/$/p
292167549Sdds}
293167549Sdds' lines1
2941590Srgrimes# Check that t clears the substitution done flag
2951590Srgrimes	mark '5.4' ; $SED -n -e '
2961590Srgrimes1,8s/^/^/
2971590Srgrimest l1
2981590Srgrimes:l1
2991590Srgrimest l2
3001590Srgrimess/$/$/p
3011590Srgrimesb
3021590Srgrimes:l2
3031590Srgrimess/^/ERROR/
3041590Srgrimes' lines1
3051590Srgrimes# Check that reading a line clears the substitution done flag
3061590Srgrimes	mark '5.5'
3071590Srgrimes	$SED -n -e '
3081590Srgrimest l2
3091590Srgrimes1,8s/^/^/p
3101590Srgrimes2,7N
3111590Srgrimesb
3121590Srgrimes:l2
3131590Srgrimess/^/ERROR/p
3141590Srgrimes' lines1
3151590Srgrimes	mark '5.6' ; $SED 5q lines1
3161590Srgrimes	mark '5.7' ; $SED -e '
3171590Srgrimes5i\
3181590Srgrimeshello
3191590Srgrimes5q' lines1
3201590Srgrimes# Branch across block boundary
3211590Srgrimes	mark '5.8' ; $SED -e '
3221590Srgrimes{
3231590Srgrimes:b
3241590Srgrimes}
3251590Srgrimess/l/m/
3261590Srgrimestb' lines1
3271590Srgrimes}
3281590Srgrimes
3291590Srgrimestest_pattern()
3301590Srgrimes{
331167552SddsCOMMENT='Pattern space commands'
3321590Srgrimes# Check that the pattern space is deleted
3331590Srgrimes	mark '6.1' ; $SED -n -e '
3341590Srgrimesc\
3351590Srgrimeschanged
3361590Srgrimesp
3371590Srgrimes' lines1
3381590Srgrimes	mark '6.2' ; $SED -n -e '
3391590Srgrimes4d
3401590Srgrimesp
3411590Srgrimes' lines1
342167549Sdds	mark '6.3'
343167552Sdds	$SED -e 'N;N;N;D' lines1
3441590Srgrimes	mark '6.4' ; $SED -e '
3451590Srgrimes2h
3461590Srgrimes3H
3471590Srgrimes4g
3481590Srgrimes5G
3491590Srgrimes6x
3501590Srgrimes6p
3511590Srgrimes6x
3521590Srgrimes6p
3531590Srgrimes' lines1
3541590Srgrimes	mark '6.5' ; $SED -e '4n' lines1
3551590Srgrimes	mark '6.6' ; $SED -n -e '4n' lines1
3561590Srgrimes}
3571590Srgrimes
3581590Srgrimestest_print()
3591590Srgrimes{
360167552Sdds	COMMENT='Print and file routines'
3611590Srgrimes	awk 'END {for (i = 1; i < 256; i++) printf("%c", i);print "\n"}' \
3621590Srgrimes		</dev/null >lines3
3631590Srgrimes	# GNU and SunOS sed behave differently here
3641590Srgrimes	mark '7.1'
365117900Sdds	$SED -n l lines3
3661590Srgrimes	mark '7.2' ; $SED -e '/l2_/=' lines1 lines2
3671590Srgrimes	rm -f lines4
3681590Srgrimes	mark '7.3' ; $SED -e '3,12w lines4' lines1
369167552Sdds	COMMENT='w results'
3701590Srgrimes	cat lines4
3711590Srgrimes	mark '7.4' ; $SED -e '4r lines2' lines1
3721590Srgrimes	mark '7.5' ; $SED -e '5r /dev/dds' lines1
3731590Srgrimes	mark '7.6' ; $SED -e '6r /dev/null' lines1
3741590Srgrimes	mark '7.7'
375167544Sdds	sed '200q' $DICT | sed 's$.*$s/^/&/w tmpdir/&$' >script1
376167544Sdds	rm -rf tmpdir
377167544Sdds	mkdir tmpdir
378167544Sdds	$SED -f script1 lines1
379167544Sdds	cat tmpdir/*
380167544Sdds	rm -rf tmpdir
3811590Srgrimes	mark '7.8'
382167552Sdds	echo line1 > lines3
383167552Sdds	echo "" >> lines3
384167552Sdds	TODO=1
385167552Sdds	$SED -n -e '$p' lines3 /dev/null
3861590Srgrimes		
3871590Srgrimes}
3881590Srgrimes
3891590Srgrimestest_subst()
3901590Srgrimes{
391167552Sdds	COMMENT='Substitution commands'
3921590Srgrimes	mark '8.1' ; $SED -e 's/./X/g' lines1
3931590Srgrimes	mark '8.2' ; $SED -e 's,.,X,g' lines1
394167549Sdds# SunOS sed thinks we are escaping . as wildcard, not as separator
395167549Sdds	mark '8.3'
396167552Sdds	$SED -e 's.\..X.g' lines1
3971590Srgrimes	mark '8.4' ; $SED -e 's/[\/]/Q/' lines1
3981590Srgrimes	mark '8.5' ; $SED -e 's_\__X_' lines1
3991590Srgrimes	mark '8.6' ; $SED -e 's/./(&)/g' lines1
4001590Srgrimes	mark '8.7' ; $SED -e 's/./(\&)/g' lines1
4011590Srgrimes	mark '8.8' ; $SED -e 's/\(.\)\(.\)\(.\)/x\3x\2x\1/g' lines1
4021590Srgrimes	mark '8.9' ; $SED -e 's/_/u0\
4031590Srgrimesu1\
4041590Srgrimesu2/g' lines1
4051590Srgrimes	mark '8.10'
4061590Srgrimes	$SED -e 's/./X/4' lines1
4071590Srgrimes	rm -f lines4
4081590Srgrimes	mark '8.11' ; $SED -e 's/1/X/w lines4' lines1
409167552Sdds	COMMENT='s wfile results'
4101590Srgrimes	cat lines4
4111590Srgrimes	mark '8.12' ; $SED -e 's/[123]/X/g' lines1
4121590Srgrimes	mark '8.13' ; $SED -e 'y/0123456789/9876543210/' lines1
4131590Srgrimes	mark '8.14' ; 
414167549Sdds	$SED -e 'y10\123456789198765432\101' lines1
4151590Srgrimes	mark '8.15' ; $SED -e '1N;2y/\n/X/' lines1
4161590Srgrimes	mark '8.16'
417117900Sdds	echo 'eeefff' | $SED -e '
418117900Sdds		p
419117900Sdds		s/e/X/p
420117900Sdds		:x
421117900Sdds		s//Y/p 
422117900Sdds		# Establish limit counter in the hold space
423117900Sdds		# GNU sed version 3.02 enters into an infinite loop here
424117900Sdds		x 
425117900Sdds		/.\{10\}/ {
426117900Sdds			s/.*/ERROR/
427117900Sdds			b
428117900Sdds		}
429117900Sdds		s/.*/&./
430117900Sdds		x 
431117900Sdds		/f/bx
432117900Sdds	'
433167549Sdds	# POSIX does not say that this should work,
434167549Sdds	# but it does for GNU, BSD, and SunOS
435167549Sdds	mark '8.17' ; $SED -e 's/[/]/Q/' lines1
436197356Sdds
437197356Sdds	COMMENT='[ as an s delimiter and its escapes'
438197356Sdds	mark '8.18' ; $SED -e 's[_[X[' lines1
439197356Sdds	# This is a matter of interpretation
440197356Sdds	# POSIX 1003.1, 2004 says "Within the BRE and the replacement,
441197356Sdds	# the BRE delimiter itself can be used as a *literal* character
442197357Sdds	# if it is preceded by a backslash"
443197357Sdds	# SunOS 5.1 /usr/bin/sed and Mac OS X follow the literal POSIX
444197357Sdds	# interpretation.
445197357Sdds	# GNU sed version 4.1.5 treats \[ as the beginning of a character
446197357Sdds	# set specification (both with --posix and without).
447197356Sdds	mark '8.19' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X['
448197356Sdds	mark '8.20' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X\[['
449197361Sdds	COMMENT='\ in y command'
450197361Sdds	mark '8.21'
451197361Sdds	echo 'a\b(c' |
452197361Sdds	$SED 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%'
453197362Sdds	COMMENT='\n in a character class and a BRE'
454197362Sdds	mark '8.22' ; (echo 1; echo 2) | $SED -n '1{;N;s/[\n]/X/;p;}'
455197362Sdds	mark '8.23' ; (echo 1; echo 2) | $SED -n '1{;N;s/\n/X/;p;}'
4561590Srgrimes}
4571590Srgrimes
4581590Srgrimestest_error()
4591590Srgrimes{
460167555Sdds	COMMENT='Error cases'
461167555Sdds	mark '9.1' ; $SED -x 2>/dev/null ; echo $?
462167555Sdds	mark '9.2' ; $SED -f 2>/dev/null ; echo $?
463167555Sdds	mark '9.3' ; $SED -e 2>/dev/null ; echo $?
464167555Sdds	mark '9.4' ; $SED -f /dev/xyzzyxyzy 2>/dev/null ; echo $?
465167555Sdds	mark '9.5' ; $SED p /dev/xyzzyxyzy 2>/dev/null ; echo $?
466167555Sdds	mark '9.6' ; $SED -f /bin/sh 2>/dev/null ; echo $?
467167555Sdds	mark '9.7' ; $SED '{' 2>/dev/null ; echo $?
468167555Sdds	mark '9.8' ; $SED '{' 2>/dev/null ; echo $?
469167555Sdds	mark '9.9' ; $SED '/hello/' 2>/dev/null ; echo $?
470167555Sdds	mark '9.10' ; $SED '1,/hello/' 2>/dev/null ; echo $?
471167555Sdds	mark '9.11' ; $SED -e '-5p' 2>/dev/null ; echo $?
472167555Sdds	mark '9.12' ; $SED '/jj' 2>/dev/null ; echo $?
473167555Sdds	mark '9.13' ; $SED 'a hello' 2>/dev/null ; echo $?
474167555Sdds	mark '9.14' ; $SED 'a \ hello' 2>/dev/null ; echo $?
475167555Sdds	mark '9.15' ; $SED 'b foo' 2>/dev/null ; echo $?
476167555Sdds	mark '9.16' ; $SED 'd hello' 2>/dev/null ; echo $?
477167555Sdds	mark '9.17' ; $SED 's/aa' 2>/dev/null ; echo $?
478167555Sdds	mark '9.18' ; $SED 's/aa/' 2>/dev/null ; echo $?
479167555Sdds	mark '9.19' ; $SED 's/a/b' 2>/dev/null ; echo $?
480167555Sdds	mark '9.20' ; $SED 's/a/b/c/d' 2>/dev/null ; echo $?
481167555Sdds	mark '9.21' ; $SED 's/a/b/ 1 2' 2>/dev/null ; echo $?
482167555Sdds	mark '9.22' ; $SED 's/a/b/ 1 g' 2>/dev/null ; echo $?
483167555Sdds	mark '9.23' ; $SED 's/a/b/w' 2>/dev/null ; echo $?
484167555Sdds	mark '9.24' ; $SED 'y/aa' 2>/dev/null ; echo $?
485167555Sdds	mark '9.25' ; $SED 'y/aa/b/' 2>/dev/null ; echo $?
486167555Sdds	mark '9.26' ; $SED 'y/aa/' 2>/dev/null ; echo $?
487167555Sdds	mark '9.27' ; $SED 'y/a/b' 2>/dev/null ; echo $?
488167555Sdds	mark '9.28' ; $SED 'y/a/b/c/d' 2>/dev/null ; echo $?
489167555Sdds	mark '9.29' ; $SED '!' 2>/dev/null ; echo $?
490167555Sdds	mark '9.30' ; $SED supercalifrangolisticexprialidociussupercalifrangolisticexcius 2>/dev/null ; echo $?
491167555Sdds	mark '9.31' ; $SED '' /dev/null 2>/dev/null ; echo $?
4921590Srgrimes}
4931590Srgrimes
4941590Srgrimesmain
495