multi_test.sh revision 174655
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 174655 2007-12-16 07:55:33Z dds $ 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 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 4351590Srgrimes} 4361590Srgrimes 4371590Srgrimestest_error() 4381590Srgrimes{ 439167555Sdds COMMENT='Error cases' 440167555Sdds mark '9.1' ; $SED -x 2>/dev/null ; echo $? 441167555Sdds mark '9.2' ; $SED -f 2>/dev/null ; echo $? 442167555Sdds mark '9.3' ; $SED -e 2>/dev/null ; echo $? 443167555Sdds mark '9.4' ; $SED -f /dev/xyzzyxyzy 2>/dev/null ; echo $? 444167555Sdds mark '9.5' ; $SED p /dev/xyzzyxyzy 2>/dev/null ; echo $? 445167555Sdds mark '9.6' ; $SED -f /bin/sh 2>/dev/null ; echo $? 446167555Sdds mark '9.7' ; $SED '{' 2>/dev/null ; echo $? 447167555Sdds mark '9.8' ; $SED '{' 2>/dev/null ; echo $? 448167555Sdds mark '9.9' ; $SED '/hello/' 2>/dev/null ; echo $? 449167555Sdds mark '9.10' ; $SED '1,/hello/' 2>/dev/null ; echo $? 450167555Sdds mark '9.11' ; $SED -e '-5p' 2>/dev/null ; echo $? 451167555Sdds mark '9.12' ; $SED '/jj' 2>/dev/null ; echo $? 452167555Sdds mark '9.13' ; $SED 'a hello' 2>/dev/null ; echo $? 453167555Sdds mark '9.14' ; $SED 'a \ hello' 2>/dev/null ; echo $? 454167555Sdds mark '9.15' ; $SED 'b foo' 2>/dev/null ; echo $? 455167555Sdds mark '9.16' ; $SED 'd hello' 2>/dev/null ; echo $? 456167555Sdds mark '9.17' ; $SED 's/aa' 2>/dev/null ; echo $? 457167555Sdds mark '9.18' ; $SED 's/aa/' 2>/dev/null ; echo $? 458167555Sdds mark '9.19' ; $SED 's/a/b' 2>/dev/null ; echo $? 459167555Sdds mark '9.20' ; $SED 's/a/b/c/d' 2>/dev/null ; echo $? 460167555Sdds mark '9.21' ; $SED 's/a/b/ 1 2' 2>/dev/null ; echo $? 461167555Sdds mark '9.22' ; $SED 's/a/b/ 1 g' 2>/dev/null ; echo $? 462167555Sdds mark '9.23' ; $SED 's/a/b/w' 2>/dev/null ; echo $? 463167555Sdds mark '9.24' ; $SED 'y/aa' 2>/dev/null ; echo $? 464167555Sdds mark '9.25' ; $SED 'y/aa/b/' 2>/dev/null ; echo $? 465167555Sdds mark '9.26' ; $SED 'y/aa/' 2>/dev/null ; echo $? 466167555Sdds mark '9.27' ; $SED 'y/a/b' 2>/dev/null ; echo $? 467167555Sdds mark '9.28' ; $SED 'y/a/b/c/d' 2>/dev/null ; echo $? 468167555Sdds mark '9.29' ; $SED '!' 2>/dev/null ; echo $? 469167555Sdds mark '9.30' ; $SED supercalifrangolisticexprialidociussupercalifrangolisticexcius 2>/dev/null ; echo $? 470167555Sdds mark '9.31' ; $SED '' /dev/null 2>/dev/null ; echo $? 4711590Srgrimes} 4721590Srgrimes 4731590Srgrimesmain 474