multi_test.sh revision 197361
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 197361 2009-09-20 15:17:40Z dds $ 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 441590Srgrimesmain() 451590Srgrimes{ 46174655Sdds cd `dirname $0` 47167552Sdds REGRESS=regress.multitest.out 481590Srgrimes DICT=/usr/share/dict/words 491590Srgrimes 501590Srgrimes awk 'END { for (i = 1; i < 15; i++) print "l1_" i}' </dev/null >lines1 511590Srgrimes awk 'END { for (i = 1; i < 10; i++) print "l2_" i}' </dev/null >lines2 521590Srgrimes 53167555Sdds echo "1..121" 54167552Sdds 551590Srgrimes exec 4>&1 5>&2 56167552Sdds tests 57167552Sdds exec 1>&4 2>&5 581590Srgrimes 59167552Sdds # Remove temporary files 60167552Sdds rm -f current.out lines[1-4] script[1-2] 611590Srgrimes} 621590Srgrimes 631590Srgrimestests() 641590Srgrimes{ 65167552Sdds SED=sed 66167552Sdds MARK=0 671590Srgrimes 681590Srgrimes test_args 691590Srgrimes test_addr 701590Srgrimes test_group 711590Srgrimes test_acid 721590Srgrimes test_branch 731590Srgrimes test_pattern 741590Srgrimes test_print 751590Srgrimes test_subst 76167555Sdds test_error 77167552Sdds # Handle the result of the last test 78167552Sdds result 791590Srgrimes} 801590Srgrimes 81167552Sdds# Display a test's result 82167552Sddsresult() 83167552Sdds{ 84167552Sdds if [ "$TODO" = '1' ] ; then 85167552Sdds TODO='TODO ' 86167552Sdds else 87167552Sdds TODO='' 88167552Sdds fi 89197352Sdds if ! [ -r $REGRESS/${TESTNAME} ] ; then 90197352Sdds echo "Seeding $REGRESS/${TESTNAME} with current result" 1>&2 91197352Sdds cp current.out $REGRESS/${TESTNAME} 92167555Sdds fi 93197352Sdds if diff -c $REGRESS/${TESTNAME} current.out ; then 94167552Sdds echo "ok $MARK $TESTNAME # $TODO$COMMENT" 95167552Sdds else 96167552Sdds echo "not ok $MARK $TESTNAME # $TODO$COMMENT" 97167552Sdds fi 1>&4 2>&5 98167552Sdds} 99167552Sdds 100167552Sdds# Mark the beginning of each test 1011590Srgrimesmark() 1021590Srgrimes{ 103167552Sdds [ $MARK -gt 0 ] && result 1041590Srgrimes MARK=`expr $MARK + 1` 105167552Sdds TESTNAME=$1 1061590Srgrimes exec 1>&4 2>&5 107167552Sdds exec >"current.out" 1081590Srgrimes} 1091590Srgrimes 1101590Srgrimestest_args() 1111590Srgrimes{ 112167552Sdds COMMENT='Argument parsing - first type' 1131590Srgrimes mark '1.1' 114167549Sdds $SED 's/^/e1_/p' lines1 1151590Srgrimes mark '1.2' ; $SED -n 's/^/e1_/p' lines1 1161590Srgrimes mark '1.3' 117167549Sdds $SED 's/^/e1_/p' <lines1 1181590Srgrimes mark '1.4' ; $SED -n 's/^/e1_/p' <lines1 119167552Sdds COMMENT='Argument parsing - second type' 1201590Srgrimes mark '1.4.1' 1211590Srgrimes $SED -e '' <lines1 1221590Srgrimes echo 's/^/s1_/p' >script1 1231590Srgrimes echo 's/^/s2_/p' >script2 1241590Srgrimes mark '1.5' 125167549Sdds $SED -f script1 lines1 1261590Srgrimes mark '1.6' 127167549Sdds $SED -f script1 <lines1 1281590Srgrimes mark '1.7' 129167549Sdds $SED -e 's/^/e1_/p' lines1 1301590Srgrimes mark '1.8' 131167549Sdds $SED -e 's/^/e1_/p' <lines1 1321590Srgrimes mark '1.9' ; $SED -n -f script1 lines1 1331590Srgrimes mark '1.10' ; $SED -n -f script1 <lines1 1341590Srgrimes mark '1.11' ; $SED -n -e 's/^/e1_/p' lines1 1351590Srgrimes mark '1.12' 136167549Sdds $SED -n -e 's/^/e1_/p' <lines1 1371590Srgrimes mark '1.13' 138167549Sdds $SED -e 's/^/e1_/p' -e 's/^/e2_/p' lines1 1391590Srgrimes mark '1.14' 140167549Sdds $SED -f script1 -f script2 lines1 1411590Srgrimes mark '1.15' 142167552Sdds $SED -e 's/^/e1_/p' -f script1 lines1 1431590Srgrimes mark '1.16' 144167549Sdds $SED -e 's/^/e1_/p' lines1 lines1 1451590Srgrimes # POSIX D11.2:11251 1461590Srgrimes mark '1.17' ; $SED p <lines1 lines1 1471590Srgrimescat >script1 <<EOF 1481590Srgrimes#n 1491590Srgrimes# A comment 1501590Srgrimes 1511590Srgrimesp 1521590SrgrimesEOF 1531590Srgrimes mark '1.18' ; $SED -f script1 <lines1 lines1 1541590Srgrimes} 1551590Srgrimes 1561590Srgrimestest_addr() 1571590Srgrimes{ 158167552Sdds COMMENT='Address ranges' 1591590Srgrimes mark '2.1' ; $SED -n -e '4p' lines1 1601590Srgrimes mark '2.2' ; $SED -n -e '20p' lines1 lines2 1611590Srgrimes mark '2.3' ; $SED -n -e '$p' lines1 1621590Srgrimes mark '2.4' ; $SED -n -e '$p' lines1 lines2 1631590Srgrimes mark '2.5' ; $SED -n -e '$a\ 1641590Srgrimeshello' /dev/null 1651590Srgrimes mark '2.6' ; $SED -n -e '$p' lines1 /dev/null lines2 1661590Srgrimes # Should not print anything 1671590Srgrimes mark '2.7' ; $SED -n -e '20p' lines1 168167546Sdds mark '2.8' ; $SED -n -e '/NOTFOUND/p' lines1 1691590Srgrimes mark '2.9' ; $SED -n '/l1_7/p' lines1 1701590Srgrimes mark '2.10' ; $SED -n ' /l1_7/ p' lines1 171167544Sdds mark '2.11' ; $SED -n '\_l1\_7_p' lines1 1721590Srgrimes mark '2.12' ; $SED -n '1,4p' lines1 1731590Srgrimes mark '2.13' ; $SED -n '1,$p' lines1 lines2 1741590Srgrimes mark '2.14' ; $SED -n '1,/l2_9/p' lines1 lines2 1751590Srgrimes mark '2.15' ; $SED -n '/4/,$p' lines1 lines2 1761590Srgrimes mark '2.16' ; $SED -n '/4/,20p' lines1 lines2 1771590Srgrimes mark '2.17' ; $SED -n '/4/,/10/p' lines1 lines2 1781590Srgrimes mark '2.18' ; $SED -n '/l2_3/,/l1_8/p' lines1 lines2 179167544Sdds mark '2.19' ; $SED -n '12,3p' lines1 lines2 180167544Sdds mark '2.20' ; $SED -n '/l1_7/,3p' lines1 lines2 181192733Sbrian mark '2.21' ; $SED -n '13,+4p' lines1 lines2 182192733Sbrian mark '2.22' ; $SED -n '/l1_6/,+2p' lines1 lines2 1831590Srgrimes} 1841590Srgrimes 1851590Srgrimestest_group() 1861590Srgrimes{ 187167552Sdds COMMENT='Brace and other grouping' 1881590Srgrimes mark '3.1' ; $SED -e ' 1891590Srgrimes4,12 { 1901590Srgrimes s/^/^/ 1911590Srgrimes s/$/$/ 1921590Srgrimes s/_/T/ 1931590Srgrimes}' lines1 1941590Srgrimes mark '3.2' ; $SED -e ' 1951590Srgrimes4,12 { 1961590Srgrimes s/^/^/ 1971590Srgrimes /6/,/10/ { 1981590Srgrimes s/$/$/ 1991590Srgrimes /8/ s/_/T/ 2001590Srgrimes } 2011590Srgrimes}' lines1 2021590Srgrimes mark '3.3' ; $SED -e ' 2031590Srgrimes4,12 !{ 2041590Srgrimes s/^/^/ 2051590Srgrimes /6/,/10/ !{ 2061590Srgrimes s/$/$/ 2071590Srgrimes /8/ !s/_/T/ 2081590Srgrimes } 2091590Srgrimes}' lines1 2101590Srgrimes mark '3.4' ; $SED -e '4,12!s/^/^/' lines1 2111590Srgrimes} 2121590Srgrimes 2131590Srgrimestest_acid() 2141590Srgrimes{ 215167552Sdds COMMENT='Commands a c d and i' 2161590Srgrimes mark '4.1' ; $SED -n -e ' 2171590Srgrimess/^/before_i/p 2181590Srgrimes20i\ 2191590Srgrimesinserted 2201590Srgrimess/^/after_i/p 2211590Srgrimes' lines1 lines2 2221590Srgrimes mark '4.2' ; $SED -n -e ' 2231590Srgrimes5,12s/^/5-12/ 2241590Srgrimess/^/before_a/p 2251590Srgrimes/5-12/a\ 2261590Srgrimesappended 2271590Srgrimess/^/after_a/p 2281590Srgrimes' lines1 lines2 2291590Srgrimes mark '4.3' 2301590Srgrimes $SED -n -e ' 2311590Srgrimess/^/^/p 2321590Srgrimes/l1_/a\ 2331590Srgrimesappended 2341590Srgrimes8,10N 2351590Srgrimess/$/$/p 2361590Srgrimes' lines1 lines2 2371590Srgrimes mark '4.4' ; $SED -n -e ' 2381590Srgrimesc\ 2391590Srgrimeshello 2401590Srgrimes' lines1 2411590Srgrimes mark '4.5' ; $SED -n -e ' 2421590Srgrimes8c\ 2431590Srgrimeshello 2441590Srgrimes' lines1 2451590Srgrimes mark '4.6' ; $SED -n -e ' 2461590Srgrimes3,14c\ 2471590Srgrimeshello 2481590Srgrimes' lines1 2491590Srgrimes# SunOS and GNU sed behave differently. We follow POSIX 250167549Sdds mark '4.7' ; $SED -n -e ' 251167549Sdds8,3c\ 252167549Sddshello 253167549Sdds' lines1 2541590Srgrimes mark '4.8' ; $SED d <lines1 2551590Srgrimes} 2561590Srgrimes 2571590Srgrimestest_branch() 2581590Srgrimes{ 259167552Sdds COMMENT='Labels and branching' 2601590Srgrimes mark '5.1' ; $SED -n -e ' 2611590Srgrimesb label4 2621590Srgrimes:label3 2631590Srgrimess/^/label3_/p 2641590Srgrimesb end 2651590Srgrimes:label4 2661590Srgrimes2,12b label1 2671590Srgrimesb label2 2681590Srgrimes:label1 2691590Srgrimess/^/label1_/p 2701590Srgrimesb 2711590Srgrimes:label2 2721590Srgrimess/^/label2_/p 2731590Srgrimesb label3 2741590Srgrimes:end 2751590Srgrimes' lines1 2761590Srgrimes mark '5.2' 2771590Srgrimes $SED -n -e ' 2781590Srgrimess/l1_/l2_/ 2791590Srgrimest ok 2801590Srgrimesb 2811590Srgrimes:ok 2821590Srgrimess/^/tested /p 2831590Srgrimes' lines1 lines2 284168257Syar# SunOS and GNU sed behave as follows: lines 9-$ aren't printed at all 285167549Sdds mark '5.3' ; $SED -n -e ' 286167549Sdds5,8b inside 287167549Sdds1,5 { 288167549Sdds s/^/^/p 289167549Sdds :inside 290167549Sdds s/$/$/p 291167549Sdds} 292167549Sdds' lines1 2931590Srgrimes# Check that t clears the substitution done flag 2941590Srgrimes mark '5.4' ; $SED -n -e ' 2951590Srgrimes1,8s/^/^/ 2961590Srgrimest l1 2971590Srgrimes:l1 2981590Srgrimest l2 2991590Srgrimess/$/$/p 3001590Srgrimesb 3011590Srgrimes:l2 3021590Srgrimess/^/ERROR/ 3031590Srgrimes' lines1 3041590Srgrimes# Check that reading a line clears the substitution done flag 3051590Srgrimes mark '5.5' 3061590Srgrimes $SED -n -e ' 3071590Srgrimest l2 3081590Srgrimes1,8s/^/^/p 3091590Srgrimes2,7N 3101590Srgrimesb 3111590Srgrimes:l2 3121590Srgrimess/^/ERROR/p 3131590Srgrimes' lines1 3141590Srgrimes mark '5.6' ; $SED 5q lines1 3151590Srgrimes mark '5.7' ; $SED -e ' 3161590Srgrimes5i\ 3171590Srgrimeshello 3181590Srgrimes5q' lines1 3191590Srgrimes# Branch across block boundary 3201590Srgrimes mark '5.8' ; $SED -e ' 3211590Srgrimes{ 3221590Srgrimes:b 3231590Srgrimes} 3241590Srgrimess/l/m/ 3251590Srgrimestb' lines1 3261590Srgrimes} 3271590Srgrimes 3281590Srgrimestest_pattern() 3291590Srgrimes{ 330167552SddsCOMMENT='Pattern space commands' 3311590Srgrimes# Check that the pattern space is deleted 3321590Srgrimes mark '6.1' ; $SED -n -e ' 3331590Srgrimesc\ 3341590Srgrimeschanged 3351590Srgrimesp 3361590Srgrimes' lines1 3371590Srgrimes mark '6.2' ; $SED -n -e ' 3381590Srgrimes4d 3391590Srgrimesp 3401590Srgrimes' lines1 341167549Sdds mark '6.3' 342167552Sdds $SED -e 'N;N;N;D' lines1 3431590Srgrimes mark '6.4' ; $SED -e ' 3441590Srgrimes2h 3451590Srgrimes3H 3461590Srgrimes4g 3471590Srgrimes5G 3481590Srgrimes6x 3491590Srgrimes6p 3501590Srgrimes6x 3511590Srgrimes6p 3521590Srgrimes' lines1 3531590Srgrimes mark '6.5' ; $SED -e '4n' lines1 3541590Srgrimes mark '6.6' ; $SED -n -e '4n' lines1 3551590Srgrimes} 3561590Srgrimes 3571590Srgrimestest_print() 3581590Srgrimes{ 359167552Sdds COMMENT='Print and file routines' 3601590Srgrimes awk 'END {for (i = 1; i < 256; i++) printf("%c", i);print "\n"}' \ 3611590Srgrimes </dev/null >lines3 3621590Srgrimes # GNU and SunOS sed behave differently here 3631590Srgrimes mark '7.1' 364117900Sdds $SED -n l lines3 3651590Srgrimes mark '7.2' ; $SED -e '/l2_/=' lines1 lines2 3661590Srgrimes rm -f lines4 3671590Srgrimes mark '7.3' ; $SED -e '3,12w lines4' lines1 368167552Sdds COMMENT='w results' 3691590Srgrimes cat lines4 3701590Srgrimes mark '7.4' ; $SED -e '4r lines2' lines1 3711590Srgrimes mark '7.5' ; $SED -e '5r /dev/dds' lines1 3721590Srgrimes mark '7.6' ; $SED -e '6r /dev/null' lines1 3731590Srgrimes mark '7.7' 374167544Sdds sed '200q' $DICT | sed 's$.*$s/^/&/w tmpdir/&$' >script1 375167544Sdds rm -rf tmpdir 376167544Sdds mkdir tmpdir 377167544Sdds $SED -f script1 lines1 378167544Sdds cat tmpdir/* 379167544Sdds rm -rf tmpdir 3801590Srgrimes mark '7.8' 381167552Sdds echo line1 > lines3 382167552Sdds echo "" >> lines3 383167552Sdds TODO=1 384167552Sdds $SED -n -e '$p' lines3 /dev/null 3851590Srgrimes 3861590Srgrimes} 3871590Srgrimes 3881590Srgrimestest_subst() 3891590Srgrimes{ 390167552Sdds COMMENT='Substitution commands' 3911590Srgrimes mark '8.1' ; $SED -e 's/./X/g' lines1 3921590Srgrimes mark '8.2' ; $SED -e 's,.,X,g' lines1 393167549Sdds# SunOS sed thinks we are escaping . as wildcard, not as separator 394167549Sdds mark '8.3' 395167552Sdds $SED -e 's.\..X.g' lines1 3961590Srgrimes mark '8.4' ; $SED -e 's/[\/]/Q/' lines1 3971590Srgrimes mark '8.5' ; $SED -e 's_\__X_' lines1 3981590Srgrimes mark '8.6' ; $SED -e 's/./(&)/g' lines1 3991590Srgrimes mark '8.7' ; $SED -e 's/./(\&)/g' lines1 4001590Srgrimes mark '8.8' ; $SED -e 's/\(.\)\(.\)\(.\)/x\3x\2x\1/g' lines1 4011590Srgrimes mark '8.9' ; $SED -e 's/_/u0\ 4021590Srgrimesu1\ 4031590Srgrimesu2/g' lines1 4041590Srgrimes mark '8.10' 4051590Srgrimes $SED -e 's/./X/4' lines1 4061590Srgrimes rm -f lines4 4071590Srgrimes mark '8.11' ; $SED -e 's/1/X/w lines4' lines1 408167552Sdds COMMENT='s wfile results' 4091590Srgrimes cat lines4 4101590Srgrimes mark '8.12' ; $SED -e 's/[123]/X/g' lines1 4111590Srgrimes mark '8.13' ; $SED -e 'y/0123456789/9876543210/' lines1 4121590Srgrimes mark '8.14' ; 413167549Sdds $SED -e 'y10\123456789198765432\101' lines1 4141590Srgrimes mark '8.15' ; $SED -e '1N;2y/\n/X/' lines1 4151590Srgrimes mark '8.16' 416117900Sdds echo 'eeefff' | $SED -e ' 417117900Sdds p 418117900Sdds s/e/X/p 419117900Sdds :x 420117900Sdds s//Y/p 421117900Sdds # Establish limit counter in the hold space 422117900Sdds # GNU sed version 3.02 enters into an infinite loop here 423117900Sdds x 424117900Sdds /.\{10\}/ { 425117900Sdds s/.*/ERROR/ 426117900Sdds b 427117900Sdds } 428117900Sdds s/.*/&./ 429117900Sdds x 430117900Sdds /f/bx 431117900Sdds ' 432167549Sdds # POSIX does not say that this should work, 433167549Sdds # but it does for GNU, BSD, and SunOS 434167549Sdds mark '8.17' ; $SED -e 's/[/]/Q/' lines1 435197356Sdds 436197356Sdds COMMENT='[ as an s delimiter and its escapes' 437197356Sdds mark '8.18' ; $SED -e 's[_[X[' lines1 438197356Sdds # This is a matter of interpretation 439197356Sdds # POSIX 1003.1, 2004 says "Within the BRE and the replacement, 440197356Sdds # the BRE delimiter itself can be used as a *literal* character 441197357Sdds # if it is preceded by a backslash" 442197357Sdds # SunOS 5.1 /usr/bin/sed and Mac OS X follow the literal POSIX 443197357Sdds # interpretation. 444197357Sdds # GNU sed version 4.1.5 treats \[ as the beginning of a character 445197357Sdds # set specification (both with --posix and without). 446197356Sdds mark '8.19' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X[' 447197356Sdds mark '8.20' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X\[[' 448197361Sdds COMMENT='\ in y command' 449197361Sdds mark '8.21' 450197361Sdds echo 'a\b(c' | 451197361Sdds $SED 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' 4521590Srgrimes} 4531590Srgrimes 4541590Srgrimestest_error() 4551590Srgrimes{ 456167555Sdds COMMENT='Error cases' 457167555Sdds mark '9.1' ; $SED -x 2>/dev/null ; echo $? 458167555Sdds mark '9.2' ; $SED -f 2>/dev/null ; echo $? 459167555Sdds mark '9.3' ; $SED -e 2>/dev/null ; echo $? 460167555Sdds mark '9.4' ; $SED -f /dev/xyzzyxyzy 2>/dev/null ; echo $? 461167555Sdds mark '9.5' ; $SED p /dev/xyzzyxyzy 2>/dev/null ; echo $? 462167555Sdds mark '9.6' ; $SED -f /bin/sh 2>/dev/null ; echo $? 463167555Sdds mark '9.7' ; $SED '{' 2>/dev/null ; echo $? 464167555Sdds mark '9.8' ; $SED '{' 2>/dev/null ; echo $? 465167555Sdds mark '9.9' ; $SED '/hello/' 2>/dev/null ; echo $? 466167555Sdds mark '9.10' ; $SED '1,/hello/' 2>/dev/null ; echo $? 467167555Sdds mark '9.11' ; $SED -e '-5p' 2>/dev/null ; echo $? 468167555Sdds mark '9.12' ; $SED '/jj' 2>/dev/null ; echo $? 469167555Sdds mark '9.13' ; $SED 'a hello' 2>/dev/null ; echo $? 470167555Sdds mark '9.14' ; $SED 'a \ hello' 2>/dev/null ; echo $? 471167555Sdds mark '9.15' ; $SED 'b foo' 2>/dev/null ; echo $? 472167555Sdds mark '9.16' ; $SED 'd hello' 2>/dev/null ; echo $? 473167555Sdds mark '9.17' ; $SED 's/aa' 2>/dev/null ; echo $? 474167555Sdds mark '9.18' ; $SED 's/aa/' 2>/dev/null ; echo $? 475167555Sdds mark '9.19' ; $SED 's/a/b' 2>/dev/null ; echo $? 476167555Sdds mark '9.20' ; $SED 's/a/b/c/d' 2>/dev/null ; echo $? 477167555Sdds mark '9.21' ; $SED 's/a/b/ 1 2' 2>/dev/null ; echo $? 478167555Sdds mark '9.22' ; $SED 's/a/b/ 1 g' 2>/dev/null ; echo $? 479167555Sdds mark '9.23' ; $SED 's/a/b/w' 2>/dev/null ; echo $? 480167555Sdds mark '9.24' ; $SED 'y/aa' 2>/dev/null ; echo $? 481167555Sdds mark '9.25' ; $SED 'y/aa/b/' 2>/dev/null ; echo $? 482167555Sdds mark '9.26' ; $SED 'y/aa/' 2>/dev/null ; echo $? 483167555Sdds mark '9.27' ; $SED 'y/a/b' 2>/dev/null ; echo $? 484167555Sdds mark '9.28' ; $SED 'y/a/b/c/d' 2>/dev/null ; echo $? 485167555Sdds mark '9.29' ; $SED '!' 2>/dev/null ; echo $? 486167555Sdds mark '9.30' ; $SED supercalifrangolisticexprialidociussupercalifrangolisticexcius 2>/dev/null ; echo $? 487167555Sdds mark '9.31' ; $SED '' /dev/null 2>/dev/null ; echo $? 4881590Srgrimes} 4891590Srgrimes 4901590Srgrimesmain 491