multi_test.sh revision 192733
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: head/tools/regression/usr.bin/sed/multitest.t 192733 2009-05-25 06:58:42Z brian $
34117900Sdds#
351590Srgrimes
361590Srgrimes# sed Regression Tests
371590Srgrimes#
38167552Sdds# The directory regress.test.out contains the expected test results
39167552Sdds#
40167552Sdds# These are the regression tests created during the development of the
41167552Sdds# BSD sed.  The reference file naming scheme used in this script can't
42167552Sdds# handle gracefully the insertion of new tests between existing ones.
43167552Sdds# Therefore, either use the new m4-based regress.t framework, or add
44167552Sdds# tests after the last existing test.
451590Srgrimes
461590Srgrimesmain()
471590Srgrimes{
48174655Sdds	cd `dirname $0`
49167552Sdds	REGRESS=regress.multitest.out
501590Srgrimes	DICT=/usr/share/dict/words
511590Srgrimes
521590Srgrimes	awk 'END { for (i = 1; i < 15; i++) print "l1_" i}' </dev/null >lines1
531590Srgrimes	awk 'END { for (i = 1; i < 10; i++) print "l2_" i}' </dev/null >lines2
541590Srgrimes
55167555Sdds	echo "1..121"
56167552Sdds
571590Srgrimes	exec 4>&1 5>&2
58167552Sdds	tests
59167552Sdds	exec 1>&4 2>&5
601590Srgrimes
61167552Sdds	# Remove temporary files
62167552Sdds	rm -f current.out lines[1-4] script[1-2]
631590Srgrimes}
641590Srgrimes
651590Srgrimestests()
661590Srgrimes{
67167552Sdds	SED=sed
68167552Sdds	MARK=0
691590Srgrimes
701590Srgrimes	test_args
711590Srgrimes	test_addr
721590Srgrimes	test_group
731590Srgrimes	test_acid
741590Srgrimes	test_branch
751590Srgrimes	test_pattern
761590Srgrimes	test_print
771590Srgrimes	test_subst
78167555Sdds	test_error
79167552Sdds	# Handle the result of the last test
80167552Sdds	result
811590Srgrimes}
821590Srgrimes
83167552Sdds# Display a test's result
84167552Sddsresult()
85167552Sdds{
86167552Sdds	if [ "$TODO" = '1' ] ; then
87167552Sdds		TODO='TODO '
88167552Sdds	else
89167552Sdds		TODO=''
90167552Sdds	fi
91167555Sdds	if ! [ -r $REGRESS/${MARK}_${TESTNAME} ] ; then
92167555Sdds		echo "Seeding $REGRESS/${MARK}_${TESTNAME} with current result" 1>&2
93167555Sdds		cp current.out $REGRESS/${MARK}_${TESTNAME}
94167555Sdds	fi
95167552Sdds	if diff -c $REGRESS/${MARK}_${TESTNAME} current.out ; then
96167552Sdds		echo "ok $MARK $TESTNAME # $TODO$COMMENT"
97167552Sdds	else
98167552Sdds		echo "not ok $MARK $TESTNAME # $TODO$COMMENT"
99167552Sdds	fi 1>&4 2>&5
100167552Sdds}
101167552Sdds
102167552Sdds# Mark the beginning of each test
1031590Srgrimesmark()
1041590Srgrimes{
105167552Sdds	[ $MARK -gt 0 ] && result
1061590Srgrimes	MARK=`expr $MARK + 1`
107167552Sdds	TESTNAME=$1
1081590Srgrimes	exec 1>&4 2>&5
109167552Sdds	exec >"current.out"
1101590Srgrimes}
1111590Srgrimes
1121590Srgrimestest_args()
1131590Srgrimes{
114167552Sdds	COMMENT='Argument parsing - first type'
1151590Srgrimes	mark '1.1'
116167549Sdds	$SED 's/^/e1_/p' lines1
1171590Srgrimes	mark '1.2' ; $SED -n 's/^/e1_/p' lines1
1181590Srgrimes	mark '1.3'
119167549Sdds	$SED 's/^/e1_/p' <lines1
1201590Srgrimes	mark '1.4' ; $SED -n 's/^/e1_/p' <lines1
121167552Sdds	COMMENT='Argument parsing - second type'
1221590Srgrimes	mark '1.4.1'
1231590Srgrimes	$SED -e '' <lines1
1241590Srgrimes	echo 's/^/s1_/p' >script1
1251590Srgrimes	echo 's/^/s2_/p' >script2
1261590Srgrimes	mark '1.5'
127167549Sdds	$SED -f script1 lines1
1281590Srgrimes	mark '1.6'
129167549Sdds	$SED -f script1 <lines1
1301590Srgrimes	mark '1.7'
131167549Sdds	$SED -e 's/^/e1_/p' lines1
1321590Srgrimes	mark '1.8'
133167549Sdds	$SED -e 's/^/e1_/p' <lines1
1341590Srgrimes	mark '1.9' ; $SED -n -f script1 lines1
1351590Srgrimes	mark '1.10' ; $SED -n -f script1 <lines1
1361590Srgrimes	mark '1.11' ; $SED -n -e 's/^/e1_/p' lines1
1371590Srgrimes	mark '1.12'
138167549Sdds	$SED -n -e 's/^/e1_/p' <lines1
1391590Srgrimes	mark '1.13'
140167549Sdds	$SED -e 's/^/e1_/p' -e 's/^/e2_/p' lines1
1411590Srgrimes	mark '1.14'
142167549Sdds	$SED -f script1 -f script2 lines1
1431590Srgrimes	mark '1.15'
144167552Sdds	$SED -e 's/^/e1_/p' -f script1 lines1
1451590Srgrimes	mark '1.16'
146167549Sdds	$SED -e 's/^/e1_/p' lines1 lines1
1471590Srgrimes	# POSIX D11.2:11251
1481590Srgrimes	mark '1.17' ; $SED p <lines1 lines1
1491590Srgrimescat >script1 <<EOF
1501590Srgrimes#n
1511590Srgrimes# A comment
1521590Srgrimes
1531590Srgrimesp
1541590SrgrimesEOF
1551590Srgrimes	mark '1.18' ; $SED -f script1 <lines1 lines1
1561590Srgrimes}
1571590Srgrimes
1581590Srgrimestest_addr()
1591590Srgrimes{
160167552Sdds	COMMENT='Address ranges'
1611590Srgrimes	mark '2.1' ; $SED -n -e '4p' lines1
1621590Srgrimes	mark '2.2' ; $SED -n -e '20p' lines1 lines2
1631590Srgrimes	mark '2.3' ; $SED -n -e '$p' lines1
1641590Srgrimes	mark '2.4' ; $SED -n -e '$p' lines1 lines2
1651590Srgrimes	mark '2.5' ; $SED -n -e '$a\
1661590Srgrimeshello' /dev/null
1671590Srgrimes	mark '2.6' ; $SED -n -e '$p' lines1 /dev/null lines2
1681590Srgrimes	# Should not print anything
1691590Srgrimes	mark '2.7' ; $SED -n -e '20p' lines1
170167546Sdds	mark '2.8' ; $SED -n -e '/NOTFOUND/p' lines1
1711590Srgrimes	mark '2.9' ; $SED -n '/l1_7/p' lines1
1721590Srgrimes	mark '2.10' ; $SED -n ' /l1_7/ p' lines1
173167544Sdds	mark '2.11' ; $SED -n '\_l1\_7_p' lines1
1741590Srgrimes	mark '2.12' ; $SED -n '1,4p' lines1
1751590Srgrimes	mark '2.13' ; $SED -n '1,$p' lines1 lines2
1761590Srgrimes	mark '2.14' ; $SED -n '1,/l2_9/p' lines1 lines2
1771590Srgrimes	mark '2.15' ; $SED -n '/4/,$p' lines1 lines2
1781590Srgrimes	mark '2.16' ; $SED -n '/4/,20p' lines1 lines2
1791590Srgrimes	mark '2.17' ; $SED -n '/4/,/10/p' lines1 lines2
1801590Srgrimes	mark '2.18' ; $SED -n '/l2_3/,/l1_8/p' lines1 lines2
181167544Sdds	mark '2.19' ; $SED -n '12,3p' lines1 lines2
182167544Sdds	mark '2.20' ; $SED -n '/l1_7/,3p' lines1 lines2
183192733Sbrian	mark '2.21' ; $SED -n '13,+4p' lines1 lines2
184192733Sbrian	mark '2.22' ; $SED -n '/l1_6/,+2p' lines1 lines2
1851590Srgrimes}
1861590Srgrimes
1871590Srgrimestest_group()
1881590Srgrimes{
189167552Sdds	COMMENT='Brace and other grouping'
1901590Srgrimes	mark '3.1' ; $SED -e '
1911590Srgrimes4,12 {
1921590Srgrimes	s/^/^/
1931590Srgrimes	s/$/$/
1941590Srgrimes	s/_/T/
1951590Srgrimes}' lines1
1961590Srgrimes	mark '3.2' ; $SED -e '
1971590Srgrimes4,12 {
1981590Srgrimes	s/^/^/
1991590Srgrimes	/6/,/10/ {
2001590Srgrimes		s/$/$/
2011590Srgrimes		/8/ s/_/T/
2021590Srgrimes	}
2031590Srgrimes}' lines1
2041590Srgrimes	mark '3.3' ; $SED -e '
2051590Srgrimes4,12 !{
2061590Srgrimes	s/^/^/
2071590Srgrimes	/6/,/10/ !{
2081590Srgrimes		s/$/$/
2091590Srgrimes		/8/ !s/_/T/
2101590Srgrimes	}
2111590Srgrimes}' lines1
2121590Srgrimes	mark '3.4' ; $SED -e '4,12!s/^/^/' lines1
2131590Srgrimes}
2141590Srgrimes
2151590Srgrimestest_acid()
2161590Srgrimes{
217167552Sdds	COMMENT='Commands a c d and i'
2181590Srgrimes	mark '4.1' ; $SED -n -e '
2191590Srgrimess/^/before_i/p
2201590Srgrimes20i\
2211590Srgrimesinserted
2221590Srgrimess/^/after_i/p
2231590Srgrimes' lines1 lines2
2241590Srgrimes	mark '4.2' ; $SED -n -e '
2251590Srgrimes5,12s/^/5-12/
2261590Srgrimess/^/before_a/p
2271590Srgrimes/5-12/a\
2281590Srgrimesappended
2291590Srgrimess/^/after_a/p
2301590Srgrimes' lines1 lines2
2311590Srgrimes	mark '4.3'
2321590Srgrimes	$SED -n -e '
2331590Srgrimess/^/^/p
2341590Srgrimes/l1_/a\
2351590Srgrimesappended
2361590Srgrimes8,10N
2371590Srgrimess/$/$/p
2381590Srgrimes' lines1 lines2
2391590Srgrimes	mark '4.4' ; $SED -n -e '
2401590Srgrimesc\
2411590Srgrimeshello
2421590Srgrimes' lines1
2431590Srgrimes	mark '4.5' ; $SED -n -e '
2441590Srgrimes8c\
2451590Srgrimeshello
2461590Srgrimes' lines1
2471590Srgrimes	mark '4.6' ; $SED -n -e '
2481590Srgrimes3,14c\
2491590Srgrimeshello
2501590Srgrimes' lines1
2511590Srgrimes# SunOS and GNU sed behave differently.   We follow POSIX
252167549Sdds	mark '4.7' ; $SED -n -e '
253167549Sdds8,3c\
254167549Sddshello
255167549Sdds' lines1
2561590Srgrimes	mark '4.8' ; $SED d <lines1
2571590Srgrimes}
2581590Srgrimes
2591590Srgrimestest_branch()
2601590Srgrimes{
261167552Sdds	COMMENT='Labels and branching'
2621590Srgrimes	mark '5.1' ; $SED -n -e '
2631590Srgrimesb label4
2641590Srgrimes:label3
2651590Srgrimess/^/label3_/p
2661590Srgrimesb end
2671590Srgrimes:label4
2681590Srgrimes2,12b label1
2691590Srgrimesb label2
2701590Srgrimes:label1
2711590Srgrimess/^/label1_/p
2721590Srgrimesb
2731590Srgrimes:label2
2741590Srgrimess/^/label2_/p
2751590Srgrimesb label3
2761590Srgrimes:end
2771590Srgrimes' lines1
2781590Srgrimes	mark '5.2'
2791590Srgrimes	$SED -n -e '
2801590Srgrimess/l1_/l2_/
2811590Srgrimest ok
2821590Srgrimesb
2831590Srgrimes:ok
2841590Srgrimess/^/tested /p
2851590Srgrimes' lines1 lines2
286168257Syar# SunOS and GNU sed behave as follows: lines 9-$ aren't printed at all
287167549Sdds	mark '5.3' ; $SED -n -e '
288167549Sdds5,8b inside
289167549Sdds1,5 {
290167549Sdds	s/^/^/p
291167549Sdds	:inside
292167549Sdds	s/$/$/p
293167549Sdds}
294167549Sdds' lines1
2951590Srgrimes# Check that t clears the substitution done flag
2961590Srgrimes	mark '5.4' ; $SED -n -e '
2971590Srgrimes1,8s/^/^/
2981590Srgrimest l1
2991590Srgrimes:l1
3001590Srgrimest l2
3011590Srgrimess/$/$/p
3021590Srgrimesb
3031590Srgrimes:l2
3041590Srgrimess/^/ERROR/
3051590Srgrimes' lines1
3061590Srgrimes# Check that reading a line clears the substitution done flag
3071590Srgrimes	mark '5.5'
3081590Srgrimes	$SED -n -e '
3091590Srgrimest l2
3101590Srgrimes1,8s/^/^/p
3111590Srgrimes2,7N
3121590Srgrimesb
3131590Srgrimes:l2
3141590Srgrimess/^/ERROR/p
3151590Srgrimes' lines1
3161590Srgrimes	mark '5.6' ; $SED 5q lines1
3171590Srgrimes	mark '5.7' ; $SED -e '
3181590Srgrimes5i\
3191590Srgrimeshello
3201590Srgrimes5q' lines1
3211590Srgrimes# Branch across block boundary
3221590Srgrimes	mark '5.8' ; $SED -e '
3231590Srgrimes{
3241590Srgrimes:b
3251590Srgrimes}
3261590Srgrimess/l/m/
3271590Srgrimestb' lines1
3281590Srgrimes}
3291590Srgrimes
3301590Srgrimestest_pattern()
3311590Srgrimes{
332167552SddsCOMMENT='Pattern space commands'
3331590Srgrimes# Check that the pattern space is deleted
3341590Srgrimes	mark '6.1' ; $SED -n -e '
3351590Srgrimesc\
3361590Srgrimeschanged
3371590Srgrimesp
3381590Srgrimes' lines1
3391590Srgrimes	mark '6.2' ; $SED -n -e '
3401590Srgrimes4d
3411590Srgrimesp
3421590Srgrimes' lines1
343167549Sdds	mark '6.3'
344167552Sdds	$SED -e 'N;N;N;D' lines1
3451590Srgrimes	mark '6.4' ; $SED -e '
3461590Srgrimes2h
3471590Srgrimes3H
3481590Srgrimes4g
3491590Srgrimes5G
3501590Srgrimes6x
3511590Srgrimes6p
3521590Srgrimes6x
3531590Srgrimes6p
3541590Srgrimes' lines1
3551590Srgrimes	mark '6.5' ; $SED -e '4n' lines1
3561590Srgrimes	mark '6.6' ; $SED -n -e '4n' lines1
3571590Srgrimes}
3581590Srgrimes
3591590Srgrimestest_print()
3601590Srgrimes{
361167552Sdds	COMMENT='Print and file routines'
3621590Srgrimes	awk 'END {for (i = 1; i < 256; i++) printf("%c", i);print "\n"}' \
3631590Srgrimes		</dev/null >lines3
3641590Srgrimes	# GNU and SunOS sed behave differently here
3651590Srgrimes	mark '7.1'
366117900Sdds	$SED -n l lines3
3671590Srgrimes	mark '7.2' ; $SED -e '/l2_/=' lines1 lines2
3681590Srgrimes	rm -f lines4
3691590Srgrimes	mark '7.3' ; $SED -e '3,12w lines4' lines1
370167552Sdds	COMMENT='w results'
3711590Srgrimes	cat lines4
3721590Srgrimes	mark '7.4' ; $SED -e '4r lines2' lines1
3731590Srgrimes	mark '7.5' ; $SED -e '5r /dev/dds' lines1
3741590Srgrimes	mark '7.6' ; $SED -e '6r /dev/null' lines1
3751590Srgrimes	mark '7.7'
376167544Sdds	sed '200q' $DICT | sed 's$.*$s/^/&/w tmpdir/&$' >script1
377167544Sdds	rm -rf tmpdir
378167544Sdds	mkdir tmpdir
379167544Sdds	$SED -f script1 lines1
380167544Sdds	cat tmpdir/*
381167544Sdds	rm -rf tmpdir
3821590Srgrimes	mark '7.8'
383167552Sdds	echo line1 > lines3
384167552Sdds	echo "" >> lines3
385167552Sdds	TODO=1
386167552Sdds	$SED -n -e '$p' lines3 /dev/null
3871590Srgrimes		
3881590Srgrimes}
3891590Srgrimes
3901590Srgrimestest_subst()
3911590Srgrimes{
392167552Sdds	COMMENT='Substitution commands'
3931590Srgrimes	mark '8.1' ; $SED -e 's/./X/g' lines1
3941590Srgrimes	mark '8.2' ; $SED -e 's,.,X,g' lines1
395167549Sdds# SunOS sed thinks we are escaping . as wildcard, not as separator
396167549Sdds	mark '8.3'
397167552Sdds	$SED -e 's.\..X.g' lines1
3981590Srgrimes	mark '8.4' ; $SED -e 's/[\/]/Q/' lines1
3991590Srgrimes	mark '8.5' ; $SED -e 's_\__X_' lines1
4001590Srgrimes	mark '8.6' ; $SED -e 's/./(&)/g' lines1
4011590Srgrimes	mark '8.7' ; $SED -e 's/./(\&)/g' lines1
4021590Srgrimes	mark '8.8' ; $SED -e 's/\(.\)\(.\)\(.\)/x\3x\2x\1/g' lines1
4031590Srgrimes	mark '8.9' ; $SED -e 's/_/u0\
4041590Srgrimesu1\
4051590Srgrimesu2/g' lines1
4061590Srgrimes	mark '8.10'
4071590Srgrimes	$SED -e 's/./X/4' lines1
4081590Srgrimes	rm -f lines4
4091590Srgrimes	mark '8.11' ; $SED -e 's/1/X/w lines4' lines1
410167552Sdds	COMMENT='s wfile results'
4111590Srgrimes	cat lines4
4121590Srgrimes	mark '8.12' ; $SED -e 's/[123]/X/g' lines1
4131590Srgrimes	mark '8.13' ; $SED -e 'y/0123456789/9876543210/' lines1
4141590Srgrimes	mark '8.14' ; 
415167549Sdds	$SED -e 'y10\123456789198765432\101' lines1
4161590Srgrimes	mark '8.15' ; $SED -e '1N;2y/\n/X/' lines1
4171590Srgrimes	mark '8.16'
418117900Sdds	echo 'eeefff' | $SED -e '
419117900Sdds		p
420117900Sdds		s/e/X/p
421117900Sdds		:x
422117900Sdds		s//Y/p 
423117900Sdds		# Establish limit counter in the hold space
424117900Sdds		# GNU sed version 3.02 enters into an infinite loop here
425117900Sdds		x 
426117900Sdds		/.\{10\}/ {
427117900Sdds			s/.*/ERROR/
428117900Sdds			b
429117900Sdds		}
430117900Sdds		s/.*/&./
431117900Sdds		x 
432117900Sdds		/f/bx
433117900Sdds	'
434167549Sdds	# POSIX does not say that this should work,
435167549Sdds	# but it does for GNU, BSD, and SunOS
436167549Sdds	mark '8.17' ; $SED -e 's/[/]/Q/' lines1
4371590Srgrimes}
4381590Srgrimes
4391590Srgrimestest_error()
4401590Srgrimes{
441167555Sdds	COMMENT='Error cases'
442167555Sdds	mark '9.1' ; $SED -x 2>/dev/null ; echo $?
443167555Sdds	mark '9.2' ; $SED -f 2>/dev/null ; echo $?
444167555Sdds	mark '9.3' ; $SED -e 2>/dev/null ; echo $?
445167555Sdds	mark '9.4' ; $SED -f /dev/xyzzyxyzy 2>/dev/null ; echo $?
446167555Sdds	mark '9.5' ; $SED p /dev/xyzzyxyzy 2>/dev/null ; echo $?
447167555Sdds	mark '9.6' ; $SED -f /bin/sh 2>/dev/null ; echo $?
448167555Sdds	mark '9.7' ; $SED '{' 2>/dev/null ; echo $?
449167555Sdds	mark '9.8' ; $SED '{' 2>/dev/null ; echo $?
450167555Sdds	mark '9.9' ; $SED '/hello/' 2>/dev/null ; echo $?
451167555Sdds	mark '9.10' ; $SED '1,/hello/' 2>/dev/null ; echo $?
452167555Sdds	mark '9.11' ; $SED -e '-5p' 2>/dev/null ; echo $?
453167555Sdds	mark '9.12' ; $SED '/jj' 2>/dev/null ; echo $?
454167555Sdds	mark '9.13' ; $SED 'a hello' 2>/dev/null ; echo $?
455167555Sdds	mark '9.14' ; $SED 'a \ hello' 2>/dev/null ; echo $?
456167555Sdds	mark '9.15' ; $SED 'b foo' 2>/dev/null ; echo $?
457167555Sdds	mark '9.16' ; $SED 'd hello' 2>/dev/null ; echo $?
458167555Sdds	mark '9.17' ; $SED 's/aa' 2>/dev/null ; echo $?
459167555Sdds	mark '9.18' ; $SED 's/aa/' 2>/dev/null ; echo $?
460167555Sdds	mark '9.19' ; $SED 's/a/b' 2>/dev/null ; echo $?
461167555Sdds	mark '9.20' ; $SED 's/a/b/c/d' 2>/dev/null ; echo $?
462167555Sdds	mark '9.21' ; $SED 's/a/b/ 1 2' 2>/dev/null ; echo $?
463167555Sdds	mark '9.22' ; $SED 's/a/b/ 1 g' 2>/dev/null ; echo $?
464167555Sdds	mark '9.23' ; $SED 's/a/b/w' 2>/dev/null ; echo $?
465167555Sdds	mark '9.24' ; $SED 'y/aa' 2>/dev/null ; echo $?
466167555Sdds	mark '9.25' ; $SED 'y/aa/b/' 2>/dev/null ; echo $?
467167555Sdds	mark '9.26' ; $SED 'y/aa/' 2>/dev/null ; echo $?
468167555Sdds	mark '9.27' ; $SED 'y/a/b' 2>/dev/null ; echo $?
469167555Sdds	mark '9.28' ; $SED 'y/a/b/c/d' 2>/dev/null ; echo $?
470167555Sdds	mark '9.29' ; $SED '!' 2>/dev/null ; echo $?
471167555Sdds	mark '9.30' ; $SED supercalifrangolisticexprialidociussupercalifrangolisticexcius 2>/dev/null ; echo $?
472167555Sdds	mark '9.31' ; $SED '' /dev/null 2>/dev/null ; echo $?
4731590Srgrimes}
4741590Srgrimes
4751590Srgrimesmain
476