OSDN Git Service

Upgrade to mksh R55.
[android-x86/external-mksh.git] / src / check.t
index 1b03af6..93c614f 100644 (file)
@@ -1,8 +1,8 @@
-# $MirOS: src/bin/mksh/check.t,v 1.756 2016/11/11 23:31:31 tg Exp $
+# $MirOS: src/bin/mksh/check.t,v 1.775 2017/04/12 17:38:41 tg Exp $
 # -*- mode: sh -*-
 #-
 # Copyright © 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#            2011, 2012, 2013, 2014, 2015, 2016
+#            2011, 2012, 2013, 2014, 2015, 2016, 2017
 #      mirabilos <m@mirbsd.org>
 #
 # Provided that these terms and disclaimer and all copyright notices
 # (2013/12/02 20:39:44) http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/regress/bin/ksh/?sortby=date
 
 expected-stdout:
-       @(#)MIRBSD KSH R54 2016/11/11
+       @(#)MIRBSD KSH R55 2017/04/12
 description:
        Check version of shell.
 stdin:
        echo $KSH_VERSION
 name: KSH_VERSION
-category: shell:legacy-no
+category: !shell:legacy-yes,!shell:textmode-yes
 ---
 expected-stdout:
-       @(#)LEGACY KSH R54 2016/11/11
+       @(#)LEGACY KSH R55 2017/04/12
 description:
        Check version of legacy shell.
 stdin:
        echo $KSH_VERSION
 name: KSH_VERSION-legacy
-category: shell:legacy-yes
+category: !shell:legacy-no,!shell:textmode-yes
+---
+expected-stdout:
+       @(#)MIRBSD KSH R55 2017/04/12 +TEXTMODE
+description:
+       Check version of shell.
+stdin:
+       echo $KSH_VERSION
+name: KSH_VERSION-textmode
+category: !shell:legacy-yes,!shell:textmode-no
+---
+expected-stdout:
+       @(#)LEGACY KSH R55 2017/04/12 +TEXTMODE
+description:
+       Check version of legacy shell.
+stdin:
+       echo $KSH_VERSION
+name: KSH_VERSION-legacy-textmode
+category: !shell:legacy-no,!shell:textmode-no
 ---
 name: selftest-1
 description:
@@ -92,23 +110,6 @@ category: disabled
 stdin:
        set
 ---
-name: selftest-legacy
-description:
-       Check some things in the LEGACY KSH
-category: shell:legacy-yes
-stdin:
-       set +o emacs
-       set +o vi
-       [[ "$(set +o) -o" = *"-o emacs -o"* ]] && echo 1=emacs
-       [[ "$(set +o) -o" = *"-o vi -o"* ]] && echo 1=vi
-       set -o emacs
-       set -o vi
-       [[ "$(set +o) -o" = *"-o emacs -o"* ]] && echo 2=emacs
-       [[ "$(set +o) -o" = *"-o vi -o"* ]] && echo 2=vi
-expected-stdout:
-       2=emacs
-       2=vi
----
 name: selftest-direct-builtin-call
 description:
        Check that direct builtin calls work
@@ -119,6 +120,26 @@ stdin:
 expected-stdout:
        -c echo  foo
 ---
+name: selftest-pathsep-unix
+description:
+       Check that $PATHSEP is set correctly.
+category: !os:os2
+stdin:
+       PATHSEP=.; export PATHSEP
+       "$__progname" -c 'print -r -- $PATHSEP'
+expected-stdout:
+       :
+---
+name: selftest-pathsep-dospath
+description:
+       Check that $PATHSEP is set correctly.
+category: os:os2
+stdin:
+       PATHSEP=.; export PATHSEP
+       "$__progname" -c 'print -r -- $PATHSEP'
+expected-stdout:
+       ;
+---
 name: alias-1
 description:
        Check that recursion is detected/avoided in aliases.
@@ -261,14 +282,42 @@ name: alias-11
 description:
        Check that special argument handling still applies with escaped aliases
 stdin:
-       alias local='\typeset'
-       function foo {
-               local x=$1 y=z
+       alias local1='\typeset'
+       alias local2='\\builtin typeset'
+       function fooa {
+               local1 x=$1 y=z
+               print -r -- "$x,$y"
+       }
+       function foob {
+               local2 x=$1 y=z
                print -r -- "$x,$y"
        }
-       foo 'bar - baz'
+       x=1 y=2; fooa 'bar - baz'
+       x=1 y=2; foob 'bar - baz'
 expected-stdout:
        bar - baz,z
+       bar - baz,z
+---
+name: alias-12
+description:
+       Something weird from Martijn Dekker
+stdin:
+       alias echo=print
+       x() { echo a; (echo b); x=$(echo c); }
+       typeset -f x
+       alias OPEN='{' CLOSE='};'
+       { OPEN echo hi1; CLOSE }
+       var=`{ OPEN echo hi2; CLOSE }` && echo "$var"
+       var=$({ OPEN echo hi3; CLOSE }) && echo "$var"
+expected-stdout:
+       x() {
+               \print a 
+               ( \print b ) 
+               x=$(\print c ) 
+       } 
+       hi1
+       hi2
+       hi3
 ---
 name: arith-compound
 description:
@@ -952,6 +1001,8 @@ stdin:
            echo end-$i
        done
        echo end-3
+       for i in a b c; do echo $i; eval break; echo bad-$i; done
+       echo end-4
 expected-stdout:
        a
        end-1
@@ -964,6 +1015,8 @@ expected-stdout:
        c:x
        end-c
        end-3
+       a
+       end-4
 ---
 name: break-2
 description:
@@ -1033,6 +1086,8 @@ stdin:
            echo end-$i
        done
        echo end-3
+       for i in a b c; do echo $i; eval continue; echo bad-$i ; done
+       echo end-4
 expected-stdout:
        a
        b
@@ -1055,6 +1110,10 @@ expected-stdout:
        c:z
        end-c
        end-3
+       a
+       b
+       c
+       end-4
 ---
 name: continue-2
 description:
@@ -2832,7 +2891,7 @@ stdin:
 expected-stdout:
        0
        bar() {
-               foo 4<<-a <<-b 5<<-c 
+               \foo 4<<-a <<-b 5<<-c 
        four
        a
        zero
@@ -4711,6 +4770,23 @@ expected-stdout:
        8 ok
        <9> <ab> <a b> .
 ---
+name: IFS-subst-10
+description:
+       Scalar context in ${var=$subst}
+stdin:
+       showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; }
+       set -- one "two three" four
+       unset -v var
+       save_IFS=$IFS
+       IFS=
+       set -- ${var=$*}
+       IFS=$save_IFS
+       echo "var=$var"
+       showargs "$@"
+expected-stdout:
+       var=onetwo threefour
+       <onetwo threefour> .
+---
 name: IFS-arith-1
 description:
        http://austingroupbugs.net/view.php?id=832
@@ -5205,6 +5281,24 @@ expected-stdout:
        line <6>
 expected-exit: 1
 ---
+name: lineno-eval-alias
+description:
+       Check if LINENO is trapped in eval and aliases
+stdin:
+       ${ZSH_VERSION+false} || emulate sh; echo $LINENO
+       echo $LINENO
+       eval '  echo $LINENO
+               echo $LINENO
+               echo $LINENO'
+       echo $LINENO
+expected-stdout:
+       1
+       2
+       3
+       3
+       3
+       6
+---
 name: unknown-trap
 description:
        Ensure unknown traps are not a syntax error
@@ -6326,7 +6420,7 @@ name: regression-62
 description:
        Check if test -nt/-ot succeeds if second(first) file is missing.
 stdin:
-       touch a
+       :>a
        test a -nt b && echo nt OK || echo nt BAD
        test b -ot a && echo ot OK || echo ot BAD
 expected-stdout:
@@ -7058,6 +7152,11 @@ description:
        Check tilde expansion works
 env-setup: !HOME=/sweet!
 stdin:
+       :>'c=a'
+       typeset c=[ab]
+       :>'d=a'
+       x=typeset; $x d=[ab]
+       echo "<$c>" "<$d>"
        wd=$PWD
        cd /
        plus=$(print -r -- ~+)
@@ -7067,10 +7166,106 @@ stdin:
        [[ $minus = "$wd" ]]; echo two $? .
        [[ $nix = /sweet ]]; echo nix $? .
 expected-stdout:
+       <[ab]> <a>
        one 0 .
        two 0 .
        nix 0 .
 ---
+name: tilde-expand-3
+description:
+       Check mostly Austin 351 stuff
+stdin:
+       showargs() { for s_arg in "$@"; do echo -n "<$s_arg> "; done; echo .; }
+       set "1 b=2" "3 d=4"
+       export a=$1 \c=$2
+       showargs 1 "$a" "$b" "$c" "$d"
+       unset a b c d
+       HOME=/tmp
+       export \a=~ b=~
+       command export c=~
+       builtin export d=~
+       \\builtin export e=~
+       showargs 2 "$a" "$b" "$c" "$d" "$e" ksh
+       unset a b c d e
+       set -o posix
+       export \a=~ b=~
+       command export c=~
+       builtin export d=~
+       \\builtin export e=~
+       showargs 3 "$a" "$b" "$c" "$d" "$e" posix
+       unset a b c d e
+       set +o posix
+       export a=$1
+       showargs 4 "$a" "$b" ksh
+       unset a b
+       showargs 5 a=$1 ksh
+       export \a=$1
+       showargs 6 "$a" "$b" ksh
+       unset a b
+       set -o posix
+       export a=$1
+       showargs 7 "$a" "$b" posix
+       unset a b
+       showargs 8 a=$1 posix
+       export \a=$1
+       showargs 9 "$a" "$b" posix
+       unset a b
+       set +o posix
+       command echo 10 ksh a=~
+       command command export a=~
+       showargs 11 "$a"
+       unset a
+       set -o posix
+       command echo 12 posix a=~
+       command command export a=~
+       showargs 13 "$a"
+       unset a
+       # unspecified whether /tmp or ~
+       var=export; command $var a=~
+       showargs 14 "$a"
+       echo 'echo "<$foo>"' >bar
+       "$__progname" bar
+       var=foo
+       export $var=1
+       "$__progname" bar
+       export $var=~
+       "$__progname" bar
+       # unspecified
+       command -- export a=~
+       showargs 18 "$a"
+       set -A bla
+       typeset bla[1]=~:~
+       global gbl=~ g2=$1
+       local lcl=~ l2=$1
+       readonly ro=~ r2=$1
+       showargs 19 "${bla[1]}" a=~ "$gbl" "$lcl" "$ro" "$g2" "$l2" "$r2"
+       set +o posix
+       echo "20 some arbitrary stuff "=~
+       set -o posix
+       echo "21 some arbitrary stuff "=~
+expected-stdout:
+       <1> <1 b=2> <> <3> <4> .
+       <2> </tmp> </tmp> </tmp> </tmp> </tmp> <ksh> .
+       <3> <~> </tmp> </tmp> <~> </tmp> <posix> .
+       <4> <1 b=2> <> <ksh> .
+       <5> <a=1> <b=2> <ksh> .
+       <6> <1> <2> <ksh> .
+       <7> <1 b=2> <> <posix> .
+       <8> <a=1> <b=2> <posix> .
+       <9> <1> <2> <posix> .
+       10 ksh a=/tmp
+       <11> </tmp> .
+       12 posix a=~
+       <13> </tmp> .
+       <14> <~> .
+       <>
+       <1>
+       <~>
+       <18> <~> .
+       <19> </tmp:/tmp> <a=~> </tmp> </tmp> </tmp> <1 b=2> <1 b=2> <1 b=2> .
+       20 some arbitrary stuff =/tmp
+       21 some arbitrary stuff =~
+---
 name: exit-err-1
 description:
        Check some "exit on error" conditions
@@ -7443,7 +7638,7 @@ expected-stdout:
        After error 2
        Exit trap
 expected-stderr-pattern:
-       /syntax error: 'newline' unexpected/
+       /syntax error: unexpected 'newline'/
 ---
 name: test-stlt-1
 description:
@@ -7553,6 +7748,58 @@ expected-stdout:
        2- 1 1 1 =
        3- 0 0 0 =
 ---
+name: test-varset-1
+description:
+       Test the test -v operator
+stdin:
+       [[ -v a ]]
+       rv=$?; echo $((++i)) $rv
+       a=
+       [[ -v a ]]
+       rv=$?; echo $((++i)) $rv
+       unset a
+       [[ -v a ]]
+       rv=$?; echo $((++i)) $rv
+       a=x
+       [[ -v a ]]
+       rv=$?; echo $((++i)) $rv
+       nameref b=a
+       [[ -v b ]]
+       rv=$?; echo $((++i)) $rv
+       unset a
+       [[ -v b ]]
+       rv=$?; echo $((++i)) $rv
+       x[1]=y
+       [[ -v x ]]
+       rv=$?; echo $((++i)) $rv
+       [[ -v x[0] ]]
+       rv=$?; echo $((++i)) $rv
+       [[ -v x[1] ]]
+       rv=$?; echo $((++i)) $rv
+       [[ -v x[2] ]]
+       rv=$?; echo $((++i)) $rv
+expected-stdout:
+       1 1
+       2 0
+       3 1
+       4 0
+       5 0
+       6 1
+       7 1
+       8 1
+       9 0
+       10 1
+---
+name: test-varset-2
+description:
+       test -v works only on scalars
+stdin:
+       [[ -v x[*] ]]
+       echo ok
+expected-exit: e != 0
+expected-stderr-pattern:
+       /unexpected '\*'/
+---
 name: test-stnze-1
 description:
        Check that the short form [ $x ] works
@@ -7903,11 +8150,11 @@ expected-stderr-pattern:
 ---
 name: typeset-1
 description:
-       Check that global does what typeset is supposed to do
+       Check that typeset -g works correctly
 stdin:
        set -A arrfoo 65
        foo() {
-               global -Uui16 arrfoo[*]
+               typeset -g -Uui16 arrfoo[*]
        }
        echo before ${arrfoo[0]} .
        foo
@@ -7917,7 +8164,7 @@ stdin:
                echo inside before ${arrbar[0]} .
                arrbar[0]=97
                echo inside changed ${arrbar[0]} .
-               global -Uui16 arrbar[*]
+               typeset -g -Uui16 arrbar[*]
                echo inside typeset ${arrbar[0]} .
                arrbar[0]=48
                echo inside changed ${arrbar[0]} .
@@ -7935,6 +8182,24 @@ expected-stdout:
        inside changed 16#30 .
        after 16#30 .
 ---
+name: typeset-2
+description:
+       Check that typeset -p on arrays works correctly
+stdin:
+       set -A x -- a b c
+       echo =
+       typeset -p x
+       echo =
+       typeset -p x[1]
+expected-stdout:
+       =
+       set -A x
+       typeset x[0]=a
+       typeset x[1]=b
+       typeset x[2]=c
+       =
+       typeset x[1]=b
+---
 name: typeset-padding-1
 description:
        Check if left/right justification works as per TFM
@@ -8081,7 +8346,7 @@ description:
        -UMKSH_ASSUME_UTF8 => not expected, but if your OS is old,
         try passing HAVE_SETLOCALE_CTYPE=0 to Build.sh
 need-pass: no
-category: !os:hpux,!os:msys
+category: !os:hpux,!os:msys,!os:os2
 need-ctty: yes
 arguments: !-i!
 env-setup: !PS1=!PS2=!LC_CTYPE=en_US.UTF-8!
@@ -8173,17 +8438,17 @@ stdin:
        alias
        typeset -f
 expected-stdout:
-       autoload='\typeset -fu'
-       functions='\typeset -f'
-       hash='\builtin alias -t'
-       history='\builtin fc -l'
-       integer='\typeset -i'
-       local='\typeset'
-       login='\exec login'
-       nameref='\typeset -n'
+       autoload='\\builtin typeset -fu'
+       functions='\\builtin typeset -f'
+       hash='\\builtin alias -t'
+       history='\\builtin fc -l'
+       integer='\\builtin typeset -i'
+       local='\\builtin typeset'
+       login='\\builtin exec login'
+       nameref='\\builtin typeset -n'
        nohup='nohup '
-       r='\builtin fc -e -'
-       type='\builtin whence -v'
+       r='\\builtin fc -e -'
+       type='\\builtin whence -v'
 ---
 name: aliases-2b
 description:
@@ -8193,17 +8458,17 @@ stdin:
        alias
        typeset -f
 expected-stdout:
-       autoload='\typeset -fu'
-       functions='\typeset -f'
-       hash='\builtin alias -t'
-       history='\builtin fc -l'
-       integer='\typeset -i'
-       local='\typeset'
-       login='\exec login'
-       nameref='\typeset -n'
+       autoload='\\builtin typeset -fu'
+       functions='\\builtin typeset -f'
+       hash='\\builtin alias -t'
+       history='\\builtin fc -l'
+       integer='\\builtin typeset -i'
+       local='\\builtin typeset'
+       login='\\builtin exec login'
+       nameref='\\builtin typeset -n'
        nohup='nohup '
-       r='\builtin fc -e -'
-       type='\builtin whence -v'
+       r='\\builtin fc -e -'
+       type='\\builtin whence -v'
 ---
 name: aliases-3b
 description:
@@ -8213,17 +8478,17 @@ stdin:
        ./sh -c 'alias; typeset -f'
        rm -f sh
 expected-stdout:
-       autoload='\typeset -fu'
-       functions='\typeset -f'
-       hash='\builtin alias -t'
-       history='\builtin fc -l'
-       integer='\typeset -i'
-       local='\typeset'
-       login='\exec login'
-       nameref='\typeset -n'
+       autoload='\\builtin typeset -fu'
+       functions='\\builtin typeset -f'
+       hash='\\builtin alias -t'
+       history='\\builtin fc -l'
+       integer='\\builtin typeset -i'
+       local='\\builtin typeset'
+       login='\\builtin exec login'
+       nameref='\\builtin typeset -n'
        nohup='nohup '
-       r='\builtin fc -e -'
-       type='\builtin whence -v'
+       r='\\builtin fc -e -'
+       type='\\builtin whence -v'
 ---
 name: aliases-cmdline
 description:
@@ -8280,8 +8545,8 @@ stdin:
        :|| local() { :; }
        alias local
 expected-stdout:
-       local='\typeset'
-       local='\typeset'
+       local='\\builtin typeset'
+       local='\\builtin typeset'
 ---
 name: arrays-1
 description:
@@ -8691,21 +8956,21 @@ expected-stdout:
 name: arrassign-fnc-global
 description:
        Check locality of array access inside a function
-       with the mksh-specific global keyword
+       with the bash4/mksh/yash/zsh typeset -g keyword
 stdin:
        function fn {
-               global x
+               typeset -g x
                x+=(f)
                echo ".fn:${x[0]}.${x[1]}.${x[2]}.${x[3]}:"
        }
        function rfn {
                set -A y
-               global y
+               typeset -g y
                y+=(f)
                echo ".rfn:${y[0]}.${y[1]}.${y[2]}.${y[3]}:"
        }
        function fnr {
-               global z
+               typeset -g z
                set -A z
                z+=(f)
                echo ".fnr:${z[0]}.${z[1]}.${z[2]}.${z[3]}:"
@@ -8843,21 +9108,21 @@ expected-stdout:
 name: strassign-fnc-global
 description:
        Check locality of string access inside a function
-       with the mksh-specific global keyword
+       with the bash4/mksh/yash/zsh typeset -g keyword
 stdin:
        function fn {
-               global x
+               typeset -g x
                x+=f
                echo ".fn:$x:"
        }
        function rfn {
                y=
-               global y
+               typeset -g y
                y+=f
                echo ".rfn:$y:"
        }
        function fnr {
-               global z
+               typeset -g z
                z=
                z+=f
                echo ".fnr:$z:"
@@ -9221,7 +9486,7 @@ stdin:
                        while (( i < ${#line[*]} )); do
                                hv=${line[i++]}
                                if (( (pos & 15) == 0 )); then
-                                       (( pos )) && print "$dasc|"
+                                       (( pos )) && print -r -- "$dasc|"
                                        print -n "${pos#16#}  "
                                        dasc=' |'
                                fi
@@ -9238,7 +9503,7 @@ stdin:
                        print -n '   '
                        (( (pos++ & 15) == 7 )) && print -n -- '- '
                done
-               (( hv == 2147483647 )) || print "$dasc|"
+               (( hv == 2147483647 )) || print -r -- "$dasc|"
        }
 expected-stdout:
        00000000  3C 64 E4 DB C3 9B E2 82 - AC C3 9B 40 3E 0A 3C 00  |<d.........@>.<.|
@@ -9277,6 +9542,7 @@ expected-stdout:
 name: print-crlf
 description:
        Check that CR+LF is shown and read as-is
+category: shell:textmode-no
 stdin:
        cat >foo <<-'EOF'
                x='bar\r
@@ -9299,6 +9565,32 @@ expected-stdout:
        {.5}
        {<bar\r}
 ---
+name: print-crlf-textmode
+description:
+       Check that CR+LF is treated as newline
+category: shell:textmode-yes
+stdin:
+       cat >foo <<-'EOF'
+               x='bar\r
+               ' #\r
+               echo .${#x} #\r
+               if test x"$KSH_VERSION" = x""; then #\r
+                       printf '<%s>' "$x" #\r
+               else #\r
+                       print -nr -- "<$x>" #\r
+               fi #\r
+       EOF
+       echo "[$("$__progname" foo)]"
+       "$__progname" foo | while IFS= read -r line; do
+               print -r -- "{$line}"
+       done
+expected-stdout:
+       [.4
+       <bar
+       >]
+       {.4}
+       {<bar}
+---
 name: print-lf
 description:
        Check that LF-only is shown and read as-is
@@ -9364,7 +9656,7 @@ stdin:
                        while [[ -n $line ]]; do
                                hv=1#${line::1}
                                if (( (pos & 15) == 0 )); then
-                                       (( pos )) && print "$dasc|"
+                                       (( pos )) && print -r -- "$dasc|"
                                        print -n "${pos#16#}  "
                                        dasc=' |'
                                fi
@@ -9382,7 +9674,7 @@ stdin:
                        print -n '   '
                        (( (pos++ & 15) == 7 )) && print -n -- '- '
                done
-               (( hv == 2147483647 )) || print "$dasc|"
+               (( hv == 2147483647 )) || print -r -- "$dasc|"
        }
 expected-stdout:
        00000000  5C 20 5C 21 5C 22 5C 23 - 5C 24 5C 25 5C 26 5C 27  |\ \!\"\#\$\%\&\'|
@@ -9391,13 +9683,13 @@ expected-stdout:
        00000030  20 5C 39 5C 3A 5C 3B 5C - 3C 5C 3D 5C 3E 5C 3F 5C  | \9\:\;\<\=\>\?\|
        00000040  40 5C 41 5C 42 5C 43 5C - 44 1B 5C 46 5C 47 5C 48  |@\A\B\C\D.\F\G\H|
        00000050  5C 49 5C 4A 5C 4B 5C 4C - 5C 4D 5C 4E 5C 4F 5C 50  |\I\J\K\L\M\N\O\P|
-       00000060  5C 51 5C 52 5C 53 5C 54 - 20 5C 56 5C 57 5C 58 5C  |\Q\R\S\T \V\W\X\|
-       00000070  59 5C 5A 5C 5B 5C 5C 5D - 5C 5E 5C 5F 5C 60 07 08  |Y\Z\[\]\^\_\`..|
-       00000080  20 20 5C 64 1B 0C 5C 67 - 5C 68 5C 69 5C 6A 5C 6B  |  \d..\g\h\i\j\k|
-       00000090  5C 6C 5C 6D 0A 5C 6F 5C - 70 20 5C 71 0D 5C 73 09  |\l\m.\o\p \q.\s.|
-       000000A0  0B 5C 77 5C 79 5C 7A 5C - 7B 5C 7C 5C 7D 5C 7E 20  |.\w\y\z\{\|\}\~ |
-       000000B0  E2 82 AC 64 20 EF BF BD - 20 12 33 20 78 20 53 20  |...d ... .3 x S |
-       000000C0  53 34 0A                -                          |S4.|
+       00000060  5C 51 5C 52 5C 53 5C 54 - 20 5C 55 5C 56 5C 57 5C  |\Q\R\S\T \U\V\W\|
+       00000070  58 5C 59 5C 5A 5C 5B 5C - 5C 5D 5C 5E 5C 5F 5C 60  |X\Y\Z\[\\]\^\_\`|
+       00000080  07 08 20 20 5C 64 1B 0C - 5C 67 5C 68 5C 69 5C 6A  |..  \d..\g\h\i\j|
+       00000090  5C 6B 5C 6C 5C 6D 0A 5C - 6F 5C 70 20 5C 71 0D 5C  |\k\l\m.\o\p \q.\|
+       000000A0  73 09 5C 75 0B 5C 77 5C - 78 5C 79 5C 7A 5C 7B 5C  |s.\u.\w\x\y\z\{\|
+       000000B0  7C 5C 7D 5C 7E 20 E2 82 - AC 64 20 EF BF BD 20 12  ||\}\~ ...d ... .|
+       000000C0  33 20 78 20 53 20 53 34 - 0A                       |3 x S S4.|
 ---
 name: dollar-doublequoted-strings
 description:
@@ -9439,7 +9731,7 @@ stdin:
                        while [[ -n $line ]]; do
                                hv=1#${line::1}
                                if (( (pos & 15) == 0 )); then
-                                       (( pos )) && print "$dasc|"
+                                       (( pos )) && print -r -- "$dasc|"
                                        print -n "${pos#16#}  "
                                        dasc=' |'
                                fi
@@ -9457,7 +9749,7 @@ stdin:
                        print -n '   '
                        (( (pos++ & 15) == 7 )) && print -n -- '- '
                done
-               (( hv == 2147483647 )) || print "$dasc|"
+               (( hv == 2147483647 )) || print -r -- "$dasc|"
        }
 expected-stdout:
        00000000  20 21 22 23 24 25 26 27 - 28 29 2A 2B 2C 2D 2E 2F  | !"#$%&'()*+,-./|
@@ -9767,7 +10059,7 @@ stdin:
                        while [[ -n $line ]]; do
                                hv=1#${line::1}
                                if (( (pos & 15) == 0 )); then
-                                       (( pos )) && print "$dasc|"
+                                       (( pos )) && print -r -- "$dasc|"
                                        print -n "${pos#16#}  "
                                        dasc=' |'
                                fi
@@ -9785,7 +10077,7 @@ stdin:
                        print -n '   '
                        (( (pos++ & 15) == 7 )) && print -n -- '- '
                done
-               (( hv == 2147483647 )) || print "$dasc|"
+               (( hv == 2147483647 )) || print -r -- "$dasc|"
        }
 expected-stdout:
        00000000  48 65 6C 6C 6F 2C 20 57 - 6F 72 6C 64 21 5C 0A E3  |Hello, World!\..|
@@ -9855,7 +10147,7 @@ stdin:
                                        dasc=$dasc$dch
                                        dch=
                                elif (( (pos & 7) == 0 )); then
-                                       (( pos )) && print "$dasc|"
+                                       (( pos )) && print -r -- "$dasc|"
                                        print -n "${pos#16#}  "
                                        dasc=' |'
                                fi
@@ -9870,7 +10162,7 @@ stdin:
                        print -n '     '
                        (( (pos++ & 7) == 3 )) && print -n -- '- '
                done
-               (( hv == 2147483647 )) || print "$dasc|"
+               (( hv == 2147483647 )) || print -r -- "$dasc|"
        }
 expected-stdout:
        00000000  0048 0065 006C 006C - 006F 002C 0020 0057  |Hello, W|
@@ -9936,7 +10228,7 @@ stdin:
                        while (( i < ${#line[*]} )); do
                                hv=${line[i++]}
                                if (( (pos & 15) == 0 )); then
-                                       (( pos )) && print "$dasc|"
+                                       (( pos )) && print -r -- "$dasc|"
                                        print -n "${pos#16#}  "
                                        dasc=' |'
                                fi
@@ -9953,7 +10245,7 @@ stdin:
                        print -n '   '
                        (( (pos++ & 15) == 7 )) && print -n -- '- '
                done
-               (( hv == 2147483647 )) || print "$dasc|"
+               (( hv == 2147483647 )) || print -r -- "$dasc|"
        }
 expected-stdout:
        00000000  48 65 6C 6C 6F 2C 20 57 - 6F 72 6C 64 21 5C 0A E3  |Hello, World!\..|
@@ -10019,7 +10311,7 @@ stdin:
                                        dasc=$dasc$dch
                                        dch=
                                elif (( (pos & 7) == 0 )); then
-                                       (( pos )) && print "$dasc|"
+                                       (( pos )) && print -r -- "$dasc|"
                                        print -n "${pos#16#}  "
                                        dasc=' |'
                                fi
@@ -10033,7 +10325,7 @@ stdin:
                        print -n '     '
                        (( (pos++ & 7) == 3 )) && print -n -- '- '
                done
-               (( hv == 2147483647 )) || print "$dasc|"
+               (( hv == 2147483647 )) || print -r -- "$dasc|"
        }
 expected-stdout:
        00000000  0048 0065 006C 006C - 006F 002C 0020 0057  |Hello, W|
@@ -10124,8 +10416,15 @@ expected-stdout:
 ---
 name: ulimit-1
 description:
+       Check that ulimit as used in dot.mksh works or is stubbed
+stdin:
+       ulimit -c 0
+---
+name: ulimit-2
+description:
        Check if we can use a specific syntax idiom for ulimit
-category: !os:syllable
+       XXX Haiku works, but only for -n and -V
+category: !os:haiku,!os:syllable
 stdin:
        if ! x=$(ulimit -d) || [[ $x = unknown ]]; then
                #echo expected to fail on this OS
@@ -10170,7 +10469,6 @@ name: bashiop-1
 description:
        Check if GNU bash-like I/O redirection works
        Part 1: this is also supported by GNU bash
-category: shell:legacy-no
 stdin:
        exec 3>&1
        function threeout {
@@ -10191,7 +10489,6 @@ name: bashiop-2a
 description:
        Check if GNU bash-like I/O redirection works
        Part 2: this is *not* supported by GNU bash
-category: shell:legacy-no
 stdin:
        exec 3>&1
        function threeout {
@@ -10212,7 +10509,6 @@ name: bashiop-2b
 description:
        Check if GNU bash-like I/O redirection works
        Part 2: this is *not* supported by GNU bash
-category: shell:legacy-no
 stdin:
        exec 3>&1
        function threeout {
@@ -10233,7 +10529,6 @@ name: bashiop-2c
 description:
        Check if GNU bash-like I/O redirection works
        Part 2: this is supported by GNU bash 4 only
-category: shell:legacy-no
 stdin:
        echo mir >foo
        set -o noclobber
@@ -10257,7 +10552,6 @@ name: bashiop-3a
 description:
        Check if GNU bash-like I/O redirection fails correctly
        Part 1: this is also supported by GNU bash
-category: shell:legacy-no
 stdin:
        echo mir >foo
        set -o noclobber
@@ -10279,7 +10573,6 @@ name: bashiop-3b
 description:
        Check if GNU bash-like I/O redirection fails correctly
        Part 2: this is *not* supported by GNU bash
-category: shell:legacy-no
 stdin:
        echo mir >foo
        set -o noclobber
@@ -10303,7 +10596,6 @@ description:
        Check if GNU bash-like I/O redirection works
        Part 4: this is also supported by GNU bash,
        but failed in some mksh versions
-category: shell:legacy-no
 stdin:
        exec 3>&1
        function threeout {
@@ -10325,11 +10617,10 @@ expected-stdout:
        ras
        dwa
 ---
-name: bashiop-5-normal
+name: bashiop-5
 description:
        Check if GNU bash-like I/O redirection is only supported
        in !POSIX !sh mode as it breaks existing scripts' syntax
-category: shell:legacy-no
 stdin:
        :>x; echo 1 "$("$__progname" -c 'echo foo>/dev/null&>x echo bar')" = "$(<x)" .
        :>x; echo 2 "$("$__progname" -o posix -c 'echo foo>/dev/null&>x echo bar')" = "$(<x)" .
@@ -10339,20 +10630,6 @@ expected-stdout:
        2  = bar .
        3  = bar .
 ---
-name: bashiop-5-legacy
-description:
-       Check if GNU bash-like I/O redirection is not parsed
-       in lksh as it breaks existing scripts' syntax
-category: shell:legacy-yes
-stdin:
-       :>x; echo 1 "$("$__progname" -c 'echo foo>/dev/null&>x echo bar')" = "$(<x)" .
-       :>x; echo 2 "$("$__progname" -o posix -c 'echo foo>/dev/null&>x echo bar')" = "$(<x)" .
-       :>x; echo 3 "$("$__progname" -o sh -c 'echo foo>/dev/null&>x echo bar')" = "$(<x)" .
-expected-stdout:
-       1  = bar .
-       2  = bar .
-       3  = bar .
----
 name: oksh-eval
 description:
        Check expansions.
@@ -10589,7 +10866,6 @@ description:
        AT&T ksh93 does this still, which means we must keep it as well
        XXX fails on some old Perl installations
 need-pass: no
-category: shell:legacy-no
 stdin:
        cat >cld <<-EOF
                #!$__perlname
@@ -10622,22 +10898,6 @@ stdin:
 expected-stdout:
        Fowl
 ---
-name: fd-cloexec-3
-description:
-       Verify that file descriptors > 2 are not private for LEGACY KSH
-category: shell:legacy-yes
-stdin:
-       cat >cld <<-EOF
-               #!$__perlname
-               open(my \$fh, ">&", 9) or die "E: open \$!";
-               syswrite(\$fh, "Fowl\\n", 5) or die "E: write \$!";
-       EOF
-       chmod +x cld
-       exec 9>&1
-       ./cld
-expected-stdout:
-       Fowl
----
 name: comsub-1a
 description:
        COMSUB are now parsed recursively, so this works
@@ -10726,10 +10986,10 @@ expected-stdout:
        x() {
                case $1 in
                (u)
-                       echo x 
+                       \echo x 
                        ;|
                (*)
-                       echo $1 
+                       \echo $1 
                        ;;
                esac 
        } 
@@ -10737,20 +10997,36 @@ expected-stdout:
 name: comsub-5
 description:
        Check COMSUB works with aliases (does not expand them twice)
+       and reentrancy safety
 stdin:
        print '#!'"$__progname"'\nfor x in "$@"; do print -r -- "$x"; done' >pfn
        chmod +x pfn
        alias echo='echo a'
        foo() {
+               echo moo
                ./pfn "$(echo foo)"
        }
        ./pfn "$(echo b)"
+       typeset -f foo >x
+       cat x
+       foo
+       . ./x
        typeset -f foo
+       foo
 expected-stdout:
        a b
        foo() {
-               ./pfn "$(echo foo )" 
+               \echo a moo 
+               ./pfn "$(\echo a foo )" 
+       } 
+       a moo
+       a foo
+       foo() {
+               \echo a moo 
+               ./pfn "$(\echo a foo )" 
        } 
+       a moo
+       a foo
 ---
 name: comsub-torture
 description:
@@ -10861,56 +11137,56 @@ expected-stdout:
                vara=1  varb='2  3'  cmd  arg1  $arg2  "$arg3  4"
        }
        inline_TCOM() {
-               vara=1 varb="2  3" cmd arg1 $arg2 "$arg3  4" 
+               vara=1 varb="2  3" \cmd arg1 $arg2 "$arg3  4" 
        } 
        function comsub_TCOM { x=$(
                vara=1  varb='2  3'  cmd  arg1  $arg2  "$arg3  4"
        ); }
        function comsub_TCOM {
-               x=$(vara=1 varb="2  3" cmd arg1 $arg2 "$arg3  4" ) 
+               x=$(vara=1 varb="2  3" \cmd arg1 $arg2 "$arg3  4" ) 
        } 
        function reread_TCOM { x=$((
                vara=1  varb='2  3'  cmd  arg1  $arg2  "$arg3  4"
        )|tr u x); }
        function reread_TCOM {
-               x=$(( vara=1 varb="2  3" cmd arg1 $arg2 "$arg3  4" ) | tr u x ) 
+               x=$( ( vara=1 varb="2  3" \cmd arg1 $arg2 "$arg3  4" ) | \tr u x ) 
        } 
        inline_TPAREN_TPIPE_TLIST() {
                (echo $foo  |  tr -dc 0-9; echo)
        }
        inline_TPAREN_TPIPE_TLIST() {
-               ( echo $foo | tr -dc 0-9 
-                 echo ) 
+               ( \echo $foo | \tr -dc 0-9 
+                 \echo ) 
        } 
        function comsub_TPAREN_TPIPE_TLIST { x=$(
                (echo $foo  |  tr -dc 0-9; echo)
        ); }
        function comsub_TPAREN_TPIPE_TLIST {
-               x=$(( echo $foo | tr -dc 0-9 ; echo ) ) 
+               x=$( ( \echo $foo | \tr -dc 0-9 ; \echo ) ) 
        } 
        function reread_TPAREN_TPIPE_TLIST { x=$((
                (echo $foo  |  tr -dc 0-9; echo)
        )|tr u x); }
        function reread_TPAREN_TPIPE_TLIST {
-               x=$(( ( echo $foo | tr -dc 0-9 ; echo ) ) | tr u x ) 
+               x=$( ( ( \echo $foo | \tr -dc 0-9 ; \echo ) ) | \tr u x ) 
        } 
        inline_TAND_TOR() {
                cmd  &&  echo ja  ||  echo nein
        }
        inline_TAND_TOR() {
-               cmd && echo ja || echo nein 
+               \cmd && \echo ja || \echo nein 
        } 
        function comsub_TAND_TOR { x=$(
                cmd  &&  echo ja  ||  echo nein
        ); }
        function comsub_TAND_TOR {
-               x=$(cmd && echo ja || echo nein ) 
+               x=$(\cmd && \echo ja || \echo nein ) 
        } 
        function reread_TAND_TOR { x=$((
                cmd  &&  echo ja  ||  echo nein
        )|tr u x); }
        function reread_TAND_TOR {
-               x=$(( cmd && echo ja || echo nein ) | tr u x ) 
+               x=$( ( \cmd && \echo ja || \echo nein ) | \tr u x ) 
        } 
        inline_TSELECT() {
                select  file  in  *;  do  echo  "<$file>" ;  break ;  done
@@ -10918,21 +11194,21 @@ expected-stdout:
        inline_TSELECT() {
                select file in * 
                do
-                       echo "<$file>" 
-                       break 
+                       \echo "<$file>" 
+                       \break 
                done 
        } 
        function comsub_TSELECT { x=$(
                select  file  in  *;  do  echo  "<$file>" ;  break ;  done
        ); }
        function comsub_TSELECT {
-               x=$(select file in * ; do echo "<$file>" ; break ; done ) 
+               x=$(select file in * ; do \echo "<$file>" ; \break ; done ) 
        } 
        function reread_TSELECT { x=$((
                select  file  in  *;  do  echo  "<$file>" ;  break ;  done
        )|tr u x); }
        function reread_TSELECT {
-               x=$(( select file in * ; do echo "<$file>" ; break ; done ) | tr u x ) 
+               x=$( ( select file in * ; do \echo "<$file>" ; \break ; done ) | \tr u x ) 
        } 
        inline_TFOR_TTIME() {
                time  for  i  in  {1,2,3}  ;  do  echo  $i ;  done
@@ -10940,20 +11216,20 @@ expected-stdout:
        inline_TFOR_TTIME() {
                time for i in {1,2,3} 
                do
-                       echo $i 
+                       \echo $i 
                done 
        } 
        function comsub_TFOR_TTIME { x=$(
                time  for  i  in  {1,2,3}  ;  do  echo  $i ;  done
        ); }
        function comsub_TFOR_TTIME {
-               x=$(time for i in {1,2,3} ; do echo $i ; done ) 
+               x=$(time for i in {1,2,3} ; do \echo $i ; done ) 
        } 
        function reread_TFOR_TTIME { x=$((
                time  for  i  in  {1,2,3}  ;  do  echo  $i ;  done
        )|tr u x); }
        function reread_TFOR_TTIME {
-               x=$(( time for i in {1,2,3} ; do echo $i ; done ) | tr u x ) 
+               x=$( ( time for i in {1,2,3} ; do \echo $i ; done ) | \tr u x ) 
        } 
        inline_TCASE() {
                case  $foo  in  1)  echo eins;& 2) echo zwei  ;| *) echo kann net bis drei zählen;;  esac
@@ -10961,13 +11237,13 @@ expected-stdout:
        inline_TCASE() {
                case $foo in
                (1)
-                       echo eins 
+                       \echo eins 
                        ;&
                (2)
-                       echo zwei 
+                       \echo zwei 
                        ;|
                (*)
-                       echo kann net bis drei zählen 
+                       \echo kann net bis drei zählen 
                        ;;
                esac 
        } 
@@ -10975,13 +11251,13 @@ expected-stdout:
                case  $foo  in  1)  echo eins;& 2) echo zwei  ;| *) echo kann net bis drei zählen;;  esac
        ); }
        function comsub_TCASE {
-               x=$(case $foo in (1) echo eins  ;& (2) echo zwei  ;| (*) echo kann net bis drei zählen  ;; esac ) 
+               x=$(case $foo in (1) \echo eins  ;& (2) \echo zwei  ;| (*) \echo kann net bis drei zählen  ;; esac ) 
        } 
        function reread_TCASE { x=$((
                case  $foo  in  1)  echo eins;& 2) echo zwei  ;| *) echo kann net bis drei zählen;;  esac
        )|tr u x); }
        function reread_TCASE {
-               x=$(( case $foo in (1) echo eins  ;& (2) echo zwei  ;| (*) echo kann net bis drei zählen  ;; esac ) | tr u x ) 
+               x=$( ( case $foo in (1) \echo eins  ;& (2) \echo zwei  ;| (*) \echo kann net bis drei zählen  ;; esac ) | \tr u x ) 
        } 
        inline_TIF_TBANG_TDBRACKET_TELIF() {
                if  !  [[  1  =  1  ]]  ;  then  echo eins;  elif [[ 1 = 2 ]]; then echo zwei  ;else echo drei; fi
@@ -10989,25 +11265,25 @@ expected-stdout:
        inline_TIF_TBANG_TDBRACKET_TELIF() {
                if ! [[ 1 = 1 ]] 
                then
-                       echo eins 
+                       \echo eins 
                elif [[ 1 = 2 ]] 
                then
-                       echo zwei 
+                       \echo zwei 
                else
-                       echo drei 
+                       \echo drei 
                fi 
        } 
        function comsub_TIF_TBANG_TDBRACKET_TELIF { x=$(
                if  !  [[  1  =  1  ]]  ;  then  echo eins;  elif [[ 1 = 2 ]]; then echo zwei  ;else echo drei; fi
        ); }
        function comsub_TIF_TBANG_TDBRACKET_TELIF {
-               x=$(if ! [[ 1 = 1 ]] ; then echo eins ; elif [[ 1 = 2 ]] ; then echo zwei ; else echo drei ; fi ) 
+               x=$(if ! [[ 1 = 1 ]] ; then \echo eins ; elif [[ 1 = 2 ]] ; then \echo zwei ; else \echo drei ; fi ) 
        } 
        function reread_TIF_TBANG_TDBRACKET_TELIF { x=$((
                if  !  [[  1  =  1  ]]  ;  then  echo eins;  elif [[ 1 = 2 ]]; then echo zwei  ;else echo drei; fi
        )|tr u x); }
        function reread_TIF_TBANG_TDBRACKET_TELIF {
-               x=$(( if ! [[ 1 = 1 ]] ; then echo eins ; elif [[ 1 = 2 ]] ; then echo zwei ; else echo drei ; fi ) | tr u x ) 
+               x=$( ( if ! [[ 1 = 1 ]] ; then \echo eins ; elif [[ 1 = 2 ]] ; then \echo zwei ; else \echo drei ; fi ) | \tr u x ) 
        } 
        inline_TWHILE() {
                i=1; while (( i < 10 )); do echo $i; let ++i; done
@@ -11015,24 +11291,24 @@ expected-stdout:
        inline_TWHILE() {
                i=1 
                while {
-                             \let] " i < 10 " 
+                             \\builtin let " i < 10 " 
                      } 
                do
-                       echo $i 
-                       let ++i 
+                       \echo $i 
+                       \let ++i 
                done 
        } 
        function comsub_TWHILE { x=$(
                i=1; while (( i < 10 )); do echo $i; let ++i; done
        ); }
        function comsub_TWHILE {
-               x=$(i=1 ; while { \let] " i < 10 " ; } ; do echo $i ; let ++i ; done ) 
+               x=$(i=1 ; while { \\builtin let " i < 10 " ; } ; do \echo $i ; \let ++i ; done ) 
        } 
        function reread_TWHILE { x=$((
                i=1; while (( i < 10 )); do echo $i; let ++i; done
        )|tr u x); }
        function reread_TWHILE {
-               x=$(( i=1 ; while { \let] " i < 10 " ; } ; do echo $i ; let ++i ; done ) | tr u x ) 
+               x=$( ( i=1 ; while { \\builtin let " i < 10 " ; } ; do \echo $i ; \let ++i ; done ) | \tr u x ) 
        } 
        inline_TUNTIL() {
                i=10; until  (( !--i )) ; do echo $i; done
@@ -11040,42 +11316,42 @@ expected-stdout:
        inline_TUNTIL() {
                i=10 
                until {
-                             \let] " !--i " 
+                             \\builtin let " !--i " 
                      } 
                do
-                       echo $i 
+                       \echo $i 
                done 
        } 
        function comsub_TUNTIL { x=$(
                i=10; until  (( !--i )) ; do echo $i; done
        ); }
        function comsub_TUNTIL {
-               x=$(i=10 ; until { \let] " !--i " ; } ; do echo $i ; done ) 
+               x=$(i=10 ; until { \\builtin let " !--i " ; } ; do \echo $i ; done ) 
        } 
        function reread_TUNTIL { x=$((
                i=10; until  (( !--i )) ; do echo $i; done
        )|tr u x); }
        function reread_TUNTIL {
-               x=$(( i=10 ; until { \let] " !--i " ; } ; do echo $i ; done ) | tr u x ) 
+               x=$( ( i=10 ; until { \\builtin let " !--i " ; } ; do \echo $i ; done ) | \tr u x ) 
        } 
        inline_TCOPROC() {
                cat  *  |&  ls
        }
        inline_TCOPROC() {
-               cat * |& 
-               ls 
+               \cat * |& 
+               \ls 
        } 
        function comsub_TCOPROC { x=$(
                cat  *  |&  ls
        ); }
        function comsub_TCOPROC {
-               x=$(cat * |&  ls ) 
+               x=$(\cat * |&  \ls ) 
        } 
        function reread_TCOPROC { x=$((
                cat  *  |&  ls
        )|tr u x); }
        function reread_TCOPROC {
-               x=$(( cat * |&  ls ) | tr u x ) 
+               x=$( ( \cat * |&  \ls ) | \tr u x ) 
        } 
        inline_TFUNCT_TBRACE_TASYNC() {
                function  korn  {  echo eins; echo zwei ;  }
@@ -11083,11 +11359,11 @@ expected-stdout:
        }
        inline_TFUNCT_TBRACE_TASYNC() {
                function korn {
-                       echo eins 
-                       echo zwei 
+                       \echo eins 
+                       \echo zwei 
                } 
                bourne() {
-                       logger * & 
+                       \logger * & 
                } 
        } 
        function comsub_TFUNCT_TBRACE_TASYNC { x=$(
@@ -11095,32 +11371,32 @@ expected-stdout:
                bourne  ()  {  logger *  &  }
        ); }
        function comsub_TFUNCT_TBRACE_TASYNC {
-               x=$(function korn { echo eins ; echo zwei ; } ; bourne() { logger * &  } ) 
+               x=$(function korn { \echo eins ; \echo zwei ; } ; bourne() { \logger * &  } ) 
        } 
        function reread_TFUNCT_TBRACE_TASYNC { x=$((
                function  korn  {  echo eins; echo zwei ;  }
                bourne  ()  {  logger *  &  }
        )|tr u x); }
        function reread_TFUNCT_TBRACE_TASYNC {
-               x=$(( function korn { echo eins ; echo zwei ; } ; bourne() { logger * &  } ) | tr u x ) 
+               x=$( ( function korn { \echo eins ; \echo zwei ; } ; bourne() { \logger * &  } ) | \tr u x ) 
        } 
        inline_IOREAD_IOCAT() {
                tr  x  u  0<foo  >>bar
        }
        inline_IOREAD_IOCAT() {
-               tr x u <foo >>bar 
+               \tr x u <foo >>bar 
        } 
        function comsub_IOREAD_IOCAT { x=$(
                tr  x  u  0<foo  >>bar
        ); }
        function comsub_IOREAD_IOCAT {
-               x=$(tr x u <foo >>bar ) 
+               x=$(\tr x u <foo >>bar ) 
        } 
        function reread_IOREAD_IOCAT { x=$((
                tr  x  u  0<foo  >>bar
        )|tr u x); }
        function reread_IOREAD_IOCAT {
-               x=$(( tr x u <foo >>bar ) | tr u x ) 
+               x=$( ( \tr x u <foo >>bar ) | \tr u x ) 
        } 
        inline_IOWRITE_IOCLOB_IOHERE_noIOSKIP() {
                cat  >|bar  <<'EOFN'
@@ -11128,7 +11404,7 @@ expected-stdout:
        EOFN
        }
        inline_IOWRITE_IOCLOB_IOHERE_noIOSKIP() {
-               cat >|bar <<"EOFN" 
+               \cat >|bar <<"EOFN" 
                foo
        EOFN
        
@@ -11139,7 +11415,7 @@ expected-stdout:
        EOFN
        ); }
        function comsub_IOWRITE_IOCLOB_IOHERE_noIOSKIP {
-               x=$(cat >|bar <<"EOFN" 
+               x=$(\cat >|bar <<"EOFN" 
                foo
        EOFN
        ) 
@@ -11150,10 +11426,10 @@ expected-stdout:
        EOFN
        )|tr u x); }
        function reread_IOWRITE_IOCLOB_IOHERE_noIOSKIP {
-               x=$(cat >|bar <<"EOFN" 
+               x=$( ( \cat >|bar <<"EOFN" 
                foo
        EOFN
-       ) | tr u x ) 
+       ) | \tr u x ) 
        } 
        inline_IOWRITE_noIOCLOB_IOHERE_IOSKIP() {
                cat  1>bar  <<-EOFI
@@ -11161,7 +11437,7 @@ expected-stdout:
                EOFI
        }
        inline_IOWRITE_noIOCLOB_IOHERE_IOSKIP() {
-               cat >bar <<-EOFI 
+               \cat >bar <<-EOFI 
        foo
        EOFI
        
@@ -11172,7 +11448,7 @@ expected-stdout:
                EOFI
        ); }
        function comsub_IOWRITE_noIOCLOB_IOHERE_IOSKIP {
-               x=$(cat >bar <<-EOFI 
+               x=$(\cat >bar <<-EOFI 
        foo
        EOFI
        ) 
@@ -11183,46 +11459,46 @@ expected-stdout:
                EOFI
        )|tr u x); }
        function reread_IOWRITE_noIOCLOB_IOHERE_IOSKIP {
-               x=$(cat >bar <<-EOFI 
+               x=$( ( \cat >bar <<-EOFI 
        foo
        EOFI
-       ) | tr u x ) 
+       ) | \tr u x ) 
        } 
        inline_IORDWR_IODUP() {
                sh  1<>/dev/console  0<&1  2>&1
        }
        inline_IORDWR_IODUP() {
-               sh 1<>/dev/console <&1 2>&1 
+               \sh 1<>/dev/console <&1 2>&1 
        } 
        function comsub_IORDWR_IODUP { x=$(
                sh  1<>/dev/console  0<&1  2>&1
        ); }
        function comsub_IORDWR_IODUP {
-               x=$(sh 1<>/dev/console <&1 2>&1 ) 
+               x=$(\sh 1<>/dev/console <&1 2>&1 ) 
        } 
        function reread_IORDWR_IODUP { x=$((
                sh  1<>/dev/console  0<&1  2>&1
        )|tr u x); }
        function reread_IORDWR_IODUP {
-               x=$(( sh 1<>/dev/console <&1 2>&1 ) | tr u x ) 
+               x=$( ( \sh 1<>/dev/console <&1 2>&1 ) | \tr u x ) 
        } 
        inline_COMSUB_EXPRSUB_FUNSUB_VALSUB() {
                echo $(true) $((1+ 2)) ${  :;} ${| REPLY=x;}
        }
        inline_COMSUB_EXPRSUB_FUNSUB_VALSUB() {
-               echo $(true ) $((1+ 2)) ${ : ;} ${|REPLY=x ;} 
+               \echo $(\true ) $((1+ 2)) ${ : ;} ${|REPLY=x ;} 
        } 
        function comsub_COMSUB_EXPRSUB_FUNSUB_VALSUB { x=$(
                echo $(true) $((1+ 2)) ${  :;} ${| REPLY=x;}
        ); }
        function comsub_COMSUB_EXPRSUB_FUNSUB_VALSUB {
-               x=$(echo $(true ) $((1+ 2)) ${ : ;} ${|REPLY=x ;} ) 
+               x=$(\echo $(\true ) $((1+ 2)) ${ : ;} ${|REPLY=x ;} ) 
        } 
        function reread_COMSUB_EXPRSUB_FUNSUB_VALSUB { x=$((
                echo $(true) $((1+ 2)) ${  :;} ${| REPLY=x;}
        )|tr u x); }
        function reread_COMSUB_EXPRSUB_FUNSUB_VALSUB {
-               x=$(( echo $(true ) $((1+ 2)) ${ : ;} ${|REPLY=x ;} ) | tr u x ) 
+               x=$( ( \echo $(\true ) $((1+ 2)) ${ : ;} ${|REPLY=x ;} ) | \tr u x ) 
        } 
        inline_QCHAR_OQUOTE_CQUOTE() {
                echo fo\ob\"a\`r\'b\$az
@@ -11230,9 +11506,9 @@ expected-stdout:
                echo 'fo\ob\"a\`r'\''b\$az'
        }
        inline_QCHAR_OQUOTE_CQUOTE() {
-               echo fo\ob\"a\`r\'b\$az 
-               echo "fo\ob\"a\`r\'b\$az" 
-               echo "fo\\ob\\\"a\\\`r"\'"b\\\$az" 
+               \echo fo\ob\"a\`r\'b\$az 
+               \echo "fo\ob\"a\`r\'b\$az" 
+               \echo "fo\\ob\\\"a\\\`r"\'"b\\\$az" 
        } 
        function comsub_QCHAR_OQUOTE_CQUOTE { x=$(
                echo fo\ob\"a\`r\'b\$az
@@ -11240,7 +11516,7 @@ expected-stdout:
                echo 'fo\ob\"a\`r'\''b\$az'
        ); }
        function comsub_QCHAR_OQUOTE_CQUOTE {
-               x=$(echo fo\ob\"a\`r\'b\$az ; echo "fo\ob\"a\`r\'b\$az" ; echo "fo\\ob\\\"a\\\`r"\'"b\\\$az" ) 
+               x=$(\echo fo\ob\"a\`r\'b\$az ; \echo "fo\ob\"a\`r\'b\$az" ; \echo "fo\\ob\\\"a\\\`r"\'"b\\\$az" ) 
        } 
        function reread_QCHAR_OQUOTE_CQUOTE { x=$((
                echo fo\ob\"a\`r\'b\$az
@@ -11248,7 +11524,7 @@ expected-stdout:
                echo 'fo\ob\"a\`r'\''b\$az'
        )|tr u x); }
        function reread_QCHAR_OQUOTE_CQUOTE {
-               x=$(( echo fo\ob\"a\`r\'b\$az ; echo "fo\ob\"a\`r\'b\$az" ; echo "fo\\ob\\\"a\\\`r"\'"b\\\$az" ) | tr u x ) 
+               x=$( ( \echo fo\ob\"a\`r\'b\$az ; \echo "fo\ob\"a\`r\'b\$az" ; \echo "fo\\ob\\\"a\\\`r"\'"b\\\$az" ) | \tr u x ) 
        } 
        inline_OSUBST_CSUBST_OPAT_SPAT_CPAT() {
                [[ ${foo#bl\(u\)b} = @(bar|baz) ]]
@@ -11266,7 +11542,7 @@ expected-stdout:
                [[ ${foo#bl\(u\)b} = @(bar|baz) ]]
        )|tr u x); }
        function reread_OSUBST_CSUBST_OPAT_SPAT_CPAT {
-               x=$(( [[ ${foo#bl\(u\)b} = @(bar|baz) ]] ) | tr u x ) 
+               x=$( ( [[ ${foo#bl\(u\)b} = @(bar|baz) ]] ) | \tr u x ) 
        } 
        inline_heredoc_closed() {
                x=$(cat <<EOFN
@@ -11274,11 +11550,11 @@ expected-stdout:
        EOFN); echo $x
        }
        inline_heredoc_closed() {
-               x=$(cat <<EOFN 
+               x=$(\cat <<EOFN 
                note there must be no space between EOFN and )
        EOFN
        ) 
-               echo $x 
+               \echo $x 
        } 
        function comsub_heredoc_closed { x=$(
                x=$(cat <<EOFN
@@ -11286,10 +11562,10 @@ expected-stdout:
        EOFN); echo $x
        ); }
        function comsub_heredoc_closed {
-               x=$(x=$(cat <<EOFN 
+               x=$(x=$(\cat <<EOFN 
                note there must be no space between EOFN and )
        EOFN
-       ) ; echo $x ) 
+       ) ; \echo $x ) 
        } 
        function reread_heredoc_closed { x=$((
                x=$(cat <<EOFN
@@ -11297,10 +11573,10 @@ expected-stdout:
        EOFN); echo $x
        )|tr u x); }
        function reread_heredoc_closed {
-               x=$(( x=$(cat <<EOFN 
+               x=$( ( x=$(\cat <<EOFN 
                note there must be no space between EOFN and )
        EOFN
-       ) ; echo $x ) | tr u x ) 
+       ) ; \echo $x ) | \tr u x ) 
        } 
        inline_heredoc_space() {
                x=$(cat <<EOFN\ 
@@ -11308,11 +11584,11 @@ expected-stdout:
        EOFN ); echo $x
        }
        inline_heredoc_space() {
-               x=$(cat <<EOFN\  
+               x=$(\cat <<EOFN\  
                note the space between EOFN and ) is actually part of the here document marker
        EOFN 
        ) 
-               echo $x 
+               \echo $x 
        } 
        function comsub_heredoc_space { x=$(
                x=$(cat <<EOFN\ 
@@ -11320,10 +11596,10 @@ expected-stdout:
        EOFN ); echo $x
        ); }
        function comsub_heredoc_space {
-               x=$(x=$(cat <<EOFN\  
+               x=$(x=$(\cat <<EOFN\  
                note the space between EOFN and ) is actually part of the here document marker
        EOFN 
-       ) ; echo $x ) 
+       ) ; \echo $x ) 
        } 
        function reread_heredoc_space { x=$((
                x=$(cat <<EOFN\ 
@@ -11331,10 +11607,10 @@ expected-stdout:
        EOFN ); echo $x
        )|tr u x); }
        function reread_heredoc_space {
-               x=$(( x=$(cat <<EOFN\  
+               x=$( ( x=$(\cat <<EOFN\  
                note the space between EOFN and ) is actually part of the here document marker
        EOFN 
-       ) ; echo $x ) | tr u x ) 
+       ) ; \echo $x ) | \tr u x ) 
        } 
        inline_patch_motd() {
                x=$(sysctl -n kern.version | sed 1q)
@@ -11353,8 +11629,8 @@ expected-stdout:
                fi
        }
        inline_patch_motd() {
-               x=$(sysctl -n kern.version | sed 1q ) 
-               [[ -s /etc/motd && "$([[ "$(head -1 /etc/motd )" != $x ]] && ed -s /etc/motd 2>&1 <<-EOF 
+               x=$(\sysctl -n kern.version | \sed 1q ) 
+               [[ -s /etc/motd && "$([[ "$(\head -1 /etc/motd )" != $x ]] && \ed -s /etc/motd 2>&1 <<-EOF 
        1,/^\$/d
        0a
        $x
@@ -11362,11 +11638,11 @@ expected-stdout:
        .
        wq
        EOF
-       )" = @(?) ]] && rm -f /etc/motd 
+       )" = @(?) ]] && \rm -f /etc/motd 
                if [[ ! -s /etc/motd ]] 
                then
-                       install -c -o root -g wheel -m 664 /dev/null /etc/motd 
-                       print -- "$x\n" >/etc/motd 
+                       \install -c -o root -g wheel -m 664 /dev/null /etc/motd 
+                       \print -- "$x\n" >/etc/motd 
                fi 
        } 
        function comsub_patch_motd { x=$(
@@ -11386,7 +11662,7 @@ expected-stdout:
                fi
        ); }
        function comsub_patch_motd {
-               x=$(x=$(sysctl -n kern.version | sed 1q ) ; [[ -s /etc/motd && "$([[ "$(head -1 /etc/motd )" != $x ]] && ed -s /etc/motd 2>&1 <<-EOF 
+               x=$(x=$(\sysctl -n kern.version | \sed 1q ) ; [[ -s /etc/motd && "$([[ "$(\head -1 /etc/motd )" != $x ]] && \ed -s /etc/motd 2>&1 <<-EOF 
        1,/^\$/d
        0a
        $x
@@ -11394,7 +11670,7 @@ expected-stdout:
        .
        wq
        EOF
-       )" = @(?) ]] && rm -f /etc/motd ; if [[ ! -s /etc/motd ]] ; then install -c -o root -g wheel -m 664 /dev/null /etc/motd ; print -- "$x\n" >/etc/motd ; fi ) 
+       )" = @(?) ]] && \rm -f /etc/motd ; if [[ ! -s /etc/motd ]] ; then \install -c -o root -g wheel -m 664 /dev/null /etc/motd ; \print -- "$x\n" >/etc/motd ; fi ) 
        } 
        function reread_patch_motd { x=$((
                x=$(sysctl -n kern.version | sed 1q)
@@ -11413,7 +11689,7 @@ expected-stdout:
                fi
        )|tr u x); }
        function reread_patch_motd {
-               x=$(( x=$(sysctl -n kern.version | sed 1q ) ; [[ -s /etc/motd && "$([[ "$(head -1 /etc/motd )" != $x ]] && ed -s /etc/motd 2>&1 <<-EOF 
+               x=$( ( x=$(\sysctl -n kern.version | \sed 1q ) ; [[ -s /etc/motd && "$([[ "$(\head -1 /etc/motd )" != $x ]] && \ed -s /etc/motd 2>&1 <<-EOF 
        1,/^\$/d
        0a
        $x
@@ -11421,7 +11697,7 @@ expected-stdout:
        .
        wq
        EOF
-       )" = @(?) ]] && rm -f /etc/motd ; if [[ ! -s /etc/motd ]] ; then install -c -o root -g wheel -m 664 /dev/null /etc/motd ; print -- "$x\n" >/etc/motd ; fi ) | tr u x ) 
+       )" = @(?) ]] && \rm -f /etc/motd ; if [[ ! -s /etc/motd ]] ; then \install -c -o root -g wheel -m 664 /dev/null /etc/motd ; \print -- "$x\n" >/etc/motd ; fi ) | \tr u x ) 
        } 
        inline_wdarrassign() {
                case x in
@@ -11432,7 +11708,7 @@ expected-stdout:
                case x in
                (x)
                        a+=b 
-                       \set -A c+ -- d e 
+                       \\builtin set -A c+ -- d e 
                        ;;
                esac 
        } 
@@ -11442,7 +11718,7 @@ expected-stdout:
                esac
        ); }
        function comsub_wdarrassign {
-               x=$(case x in (x) a+=b ; \set -A c+ -- d e  ;; esac ) 
+               x=$(case x in (x) a+=b ; \\builtin set -A c+ -- d e  ;; esac ) 
        } 
        function reread_wdarrassign { x=$((
                case x in
@@ -11450,7 +11726,7 @@ expected-stdout:
                esac
        )|tr u x); }
        function reread_wdarrassign {
-               x=$(( case x in (x) a+=b ; \set -A c+ -- d e  ;; esac ) | tr u x ) 
+               x=$( ( case x in (x) a+=b ; \\builtin set -A c+ -- d e  ;; esac ) | \tr u x ) 
        } 
 ---
 name: comsub-torture-io
@@ -11517,56 +11793,56 @@ expected-stdout:
                vara=1  varb='2  3'  cmd  arg1  $arg2  "$arg3  4" >&3
        }
        inline_TCOM() {
-               vara=1 varb="2  3" cmd arg1 $arg2 "$arg3  4" >&3 
+               vara=1 varb="2  3" \cmd arg1 $arg2 "$arg3  4" >&3 
        } 
        function comsub_TCOM { x=$(
                vara=1  varb='2  3'  cmd  arg1  $arg2  "$arg3  4" >&3
        ); }
        function comsub_TCOM {
-               x=$(vara=1 varb="2  3" cmd arg1 $arg2 "$arg3  4" >&3 ) 
+               x=$(vara=1 varb="2  3" \cmd arg1 $arg2 "$arg3  4" >&3 ) 
        } 
        function reread_TCOM { x=$((
                vara=1  varb='2  3'  cmd  arg1  $arg2  "$arg3  4" >&3
        )|tr u x); }
        function reread_TCOM {
-               x=$(( vara=1 varb="2  3" cmd arg1 $arg2 "$arg3  4" >&3 ) | tr u x ) 
+               x=$( ( vara=1 varb="2  3" \cmd arg1 $arg2 "$arg3  4" >&3 ) | \tr u x ) 
        } 
        inline_TPAREN_TPIPE_TLIST() {
                (echo $foo  |  tr -dc 0-9 >&3; echo >&3) >&3
        }
        inline_TPAREN_TPIPE_TLIST() {
-               ( echo $foo | tr -dc 0-9 >&3 
-                 echo >&3 ) >&3 
+               ( \echo $foo | \tr -dc 0-9 >&3 
+                 \echo >&3 ) >&3 
        } 
        function comsub_TPAREN_TPIPE_TLIST { x=$(
                (echo $foo  |  tr -dc 0-9 >&3; echo >&3) >&3
        ); }
        function comsub_TPAREN_TPIPE_TLIST {
-               x=$(( echo $foo | tr -dc 0-9 >&3 ; echo >&3 ) >&3 ) 
+               x=$( ( \echo $foo | \tr -dc 0-9 >&3 ; \echo >&3 ) >&3 ) 
        } 
        function reread_TPAREN_TPIPE_TLIST { x=$((
                (echo $foo  |  tr -dc 0-9 >&3; echo >&3) >&3
        )|tr u x); }
        function reread_TPAREN_TPIPE_TLIST {
-               x=$(( ( echo $foo | tr -dc 0-9 >&3 ; echo >&3 ) >&3 ) | tr u x ) 
+               x=$( ( ( \echo $foo | \tr -dc 0-9 >&3 ; \echo >&3 ) >&3 ) | \tr u x ) 
        } 
        inline_TAND_TOR() {
                cmd  >&3 &&  >&3 echo ja  ||  echo >&3 nein
        }
        inline_TAND_TOR() {
-               cmd >&3 && echo ja >&3 || echo nein >&3 
+               \cmd >&3 && \echo ja >&3 || \echo nein >&3 
        } 
        function comsub_TAND_TOR { x=$(
                cmd  >&3 &&  >&3 echo ja  ||  echo >&3 nein
        ); }
        function comsub_TAND_TOR {
-               x=$(cmd >&3 && echo ja >&3 || echo nein >&3 ) 
+               x=$(\cmd >&3 && \echo ja >&3 || \echo nein >&3 ) 
        } 
        function reread_TAND_TOR { x=$((
                cmd  >&3 &&  >&3 echo ja  ||  echo >&3 nein
        )|tr u x); }
        function reread_TAND_TOR {
-               x=$(( cmd >&3 && echo ja >&3 || echo nein >&3 ) | tr u x ) 
+               x=$( ( \cmd >&3 && \echo ja >&3 || \echo nein >&3 ) | \tr u x ) 
        } 
        inline_TSELECT() {
                select  file  in  *;  do  echo  "<$file>" ;  break >&3 ;  done >&3
@@ -11574,21 +11850,21 @@ expected-stdout:
        inline_TSELECT() {
                select file in * 
                do
-                       echo "<$file>" 
-                       break >&3 
+                       \echo "<$file>" 
+                       \break >&3 
                done >&3 
        } 
        function comsub_TSELECT { x=$(
                select  file  in  *;  do  echo  "<$file>" ;  break >&3 ;  done >&3
        ); }
        function comsub_TSELECT {
-               x=$(select file in * ; do echo "<$file>" ; break >&3 ; done >&3 ) 
+               x=$(select file in * ; do \echo "<$file>" ; \break >&3 ; done >&3 ) 
        } 
        function reread_TSELECT { x=$((
                select  file  in  *;  do  echo  "<$file>" ;  break >&3 ;  done >&3
        )|tr u x); }
        function reread_TSELECT {
-               x=$(( select file in * ; do echo "<$file>" ; break >&3 ; done >&3 ) | tr u x ) 
+               x=$( ( select file in * ; do \echo "<$file>" ; \break >&3 ; done >&3 ) | \tr u x ) 
        } 
        inline_TFOR_TTIME() {
                for  i  in  {1,2,3}  ;  do  time  >&3 echo  $i ;  done >&3
@@ -11596,20 +11872,20 @@ expected-stdout:
        inline_TFOR_TTIME() {
                for i in {1,2,3} 
                do
-                       time echo $i >&3 
+                       time \echo $i >&3 
                done >&3 
        } 
        function comsub_TFOR_TTIME { x=$(
                for  i  in  {1,2,3}  ;  do  time  >&3 echo  $i ;  done >&3
        ); }
        function comsub_TFOR_TTIME {
-               x=$(for i in {1,2,3} ; do time echo $i >&3 ; done >&3 ) 
+               x=$(for i in {1,2,3} ; do time \echo $i >&3 ; done >&3 ) 
        } 
        function reread_TFOR_TTIME { x=$((
                for  i  in  {1,2,3}  ;  do  time  >&3 echo  $i ;  done >&3
        )|tr u x); }
        function reread_TFOR_TTIME {
-               x=$(( for i in {1,2,3} ; do time echo $i >&3 ; done >&3 ) | tr u x ) 
+               x=$( ( for i in {1,2,3} ; do time \echo $i >&3 ; done >&3 ) | \tr u x ) 
        } 
        inline_TCASE() {
                case  $foo  in  1)  echo eins >&3;& 2) echo zwei >&3  ;| *) echo kann net bis drei zählen >&3;;  esac >&3
@@ -11617,13 +11893,13 @@ expected-stdout:
        inline_TCASE() {
                case $foo in
                (1)
-                       echo eins >&3 
+                       \echo eins >&3 
                        ;&
                (2)
-                       echo zwei >&3 
+                       \echo zwei >&3 
                        ;|
                (*)
-                       echo kann net bis drei zählen >&3 
+                       \echo kann net bis drei zählen >&3 
                        ;;
                esac >&3 
        } 
@@ -11631,13 +11907,13 @@ expected-stdout:
                case  $foo  in  1)  echo eins >&3;& 2) echo zwei >&3  ;| *) echo kann net bis drei zählen >&3;;  esac >&3
        ); }
        function comsub_TCASE {
-               x=$(case $foo in (1) echo eins >&3  ;& (2) echo zwei >&3  ;| (*) echo kann net bis drei zählen >&3  ;; esac >&3 ) 
+               x=$(case $foo in (1) \echo eins >&3  ;& (2) \echo zwei >&3  ;| (*) \echo kann net bis drei zählen >&3  ;; esac >&3 ) 
        } 
        function reread_TCASE { x=$((
                case  $foo  in  1)  echo eins >&3;& 2) echo zwei >&3  ;| *) echo kann net bis drei zählen >&3;;  esac >&3
        )|tr u x); }
        function reread_TCASE {
-               x=$(( case $foo in (1) echo eins >&3  ;& (2) echo zwei >&3  ;| (*) echo kann net bis drei zählen >&3  ;; esac >&3 ) | tr u x ) 
+               x=$( ( case $foo in (1) \echo eins >&3  ;& (2) \echo zwei >&3  ;| (*) \echo kann net bis drei zählen >&3  ;; esac >&3 ) | \tr u x ) 
        } 
        inline_TIF_TBANG_TDBRACKET_TELIF() {
                if  !  [[  1  =  1  ]]  >&3 ;  then  echo eins;  elif [[ 1 = 2 ]] >&3; then echo zwei  ;else echo drei; fi >&3
@@ -11645,25 +11921,25 @@ expected-stdout:
        inline_TIF_TBANG_TDBRACKET_TELIF() {
                if ! [[ 1 = 1 ]] >&3 
                then
-                       echo eins 
+                       \echo eins 
                elif [[ 1 = 2 ]] >&3 
                then
-                       echo zwei 
+                       \echo zwei 
                else
-                       echo drei 
+                       \echo drei 
                fi >&3 
        } 
        function comsub_TIF_TBANG_TDBRACKET_TELIF { x=$(
                if  !  [[  1  =  1  ]]  >&3 ;  then  echo eins;  elif [[ 1 = 2 ]] >&3; then echo zwei  ;else echo drei; fi >&3
        ); }
        function comsub_TIF_TBANG_TDBRACKET_TELIF {
-               x=$(if ! [[ 1 = 1 ]] >&3 ; then echo eins ; elif [[ 1 = 2 ]] >&3 ; then echo zwei ; else echo drei ; fi >&3 ) 
+               x=$(if ! [[ 1 = 1 ]] >&3 ; then \echo eins ; elif [[ 1 = 2 ]] >&3 ; then \echo zwei ; else \echo drei ; fi >&3 ) 
        } 
        function reread_TIF_TBANG_TDBRACKET_TELIF { x=$((
                if  !  [[  1  =  1  ]]  >&3 ;  then  echo eins;  elif [[ 1 = 2 ]] >&3; then echo zwei  ;else echo drei; fi >&3
        )|tr u x); }
        function reread_TIF_TBANG_TDBRACKET_TELIF {
-               x=$(( if ! [[ 1 = 1 ]] >&3 ; then echo eins ; elif [[ 1 = 2 ]] >&3 ; then echo zwei ; else echo drei ; fi >&3 ) | tr u x ) 
+               x=$( ( if ! [[ 1 = 1 ]] >&3 ; then \echo eins ; elif [[ 1 = 2 ]] >&3 ; then \echo zwei ; else \echo drei ; fi >&3 ) | \tr u x ) 
        } 
        inline_TWHILE() {
                i=1; while (( i < 10 )) >&3; do echo $i; let ++i; done >&3
@@ -11671,24 +11947,24 @@ expected-stdout:
        inline_TWHILE() {
                i=1 
                while {
-                             \let] " i < 10 " 
+                             \\builtin let " i < 10 " 
                      } >&3 
                do
-                       echo $i 
-                       let ++i 
+                       \echo $i 
+                       \let ++i 
                done >&3 
        } 
        function comsub_TWHILE { x=$(
                i=1; while (( i < 10 )) >&3; do echo $i; let ++i; done >&3
        ); }
        function comsub_TWHILE {
-               x=$(i=1 ; while { \let] " i < 10 " ; } >&3 ; do echo $i ; let ++i ; done >&3 ) 
+               x=$(i=1 ; while { \\builtin let " i < 10 " ; } >&3 ; do \echo $i ; \let ++i ; done >&3 ) 
        } 
        function reread_TWHILE { x=$((
                i=1; while (( i < 10 )) >&3; do echo $i; let ++i; done >&3
        )|tr u x); }
        function reread_TWHILE {
-               x=$(( i=1 ; while { \let] " i < 10 " ; } >&3 ; do echo $i ; let ++i ; done >&3 ) | tr u x ) 
+               x=$( ( i=1 ; while { \\builtin let " i < 10 " ; } >&3 ; do \echo $i ; \let ++i ; done >&3 ) | \tr u x ) 
        } 
        inline_TUNTIL() {
                i=10; until  (( !--i )) >&3 ; do echo $i; done >&3
@@ -11696,42 +11972,42 @@ expected-stdout:
        inline_TUNTIL() {
                i=10 
                until {
-                             \let] " !--i " 
+                             \\builtin let " !--i " 
                      } >&3 
                do
-                       echo $i 
+                       \echo $i 
                done >&3 
        } 
        function comsub_TUNTIL { x=$(
                i=10; until  (( !--i )) >&3 ; do echo $i; done >&3
        ); }
        function comsub_TUNTIL {
-               x=$(i=10 ; until { \let] " !--i " ; } >&3 ; do echo $i ; done >&3 ) 
+               x=$(i=10 ; until { \\builtin let " !--i " ; } >&3 ; do \echo $i ; done >&3 ) 
        } 
        function reread_TUNTIL { x=$((
                i=10; until  (( !--i )) >&3 ; do echo $i; done >&3
        )|tr u x); }
        function reread_TUNTIL {
-               x=$(( i=10 ; until { \let] " !--i " ; } >&3 ; do echo $i ; done >&3 ) | tr u x ) 
+               x=$( ( i=10 ; until { \\builtin let " !--i " ; } >&3 ; do \echo $i ; done >&3 ) | \tr u x ) 
        } 
        inline_TCOPROC() {
                cat  *  >&3 |&  >&3 ls
        }
        inline_TCOPROC() {
-               cat * >&3 |& 
-               ls >&3 
+               \cat * >&3 |& 
+               \ls >&3 
        } 
        function comsub_TCOPROC { x=$(
                cat  *  >&3 |&  >&3 ls
        ); }
        function comsub_TCOPROC {
-               x=$(cat * >&3 |&  ls >&3 ) 
+               x=$(\cat * >&3 |&  \ls >&3 ) 
        } 
        function reread_TCOPROC { x=$((
                cat  *  >&3 |&  >&3 ls
        )|tr u x); }
        function reread_TCOPROC {
-               x=$(( cat * >&3 |&  ls >&3 ) | tr u x ) 
+               x=$( ( \cat * >&3 |&  \ls >&3 ) | \tr u x ) 
        } 
        inline_TFUNCT_TBRACE_TASYNC() {
                function  korn  {  echo eins; echo >&3 zwei ;  }
@@ -11739,11 +12015,11 @@ expected-stdout:
        }
        inline_TFUNCT_TBRACE_TASYNC() {
                function korn {
-                       echo eins 
-                       echo zwei >&3 
+                       \echo eins 
+                       \echo zwei >&3 
                } 
                bourne() {
-                       logger * >&3 & 
+                       \logger * >&3 & 
                } 
        } 
        function comsub_TFUNCT_TBRACE_TASYNC { x=$(
@@ -11751,32 +12027,32 @@ expected-stdout:
                bourne  ()  {  logger *  >&3 &  }
        ); }
        function comsub_TFUNCT_TBRACE_TASYNC {
-               x=$(function korn { echo eins ; echo zwei >&3 ; } ; bourne() { logger * >&3 &  } ) 
+               x=$(function korn { \echo eins ; \echo zwei >&3 ; } ; bourne() { \logger * >&3 &  } ) 
        } 
        function reread_TFUNCT_TBRACE_TASYNC { x=$((
                function  korn  {  echo eins; echo >&3 zwei ;  }
                bourne  ()  {  logger *  >&3 &  }
        )|tr u x); }
        function reread_TFUNCT_TBRACE_TASYNC {
-               x=$(( function korn { echo eins ; echo zwei >&3 ; } ; bourne() { logger * >&3 &  } ) | tr u x ) 
+               x=$( ( function korn { \echo eins ; \echo zwei >&3 ; } ; bourne() { \logger * >&3 &  } ) | \tr u x ) 
        } 
        inline_COMSUB_EXPRSUB() {
                echo $(true >&3) $((1+ 2))
        }
        inline_COMSUB_EXPRSUB() {
-               echo $(true >&3 ) $((1+ 2)) 
+               \echo $(\true >&3 ) $((1+ 2)) 
        } 
        function comsub_COMSUB_EXPRSUB { x=$(
                echo $(true >&3) $((1+ 2))
        ); }
        function comsub_COMSUB_EXPRSUB {
-               x=$(echo $(true >&3 ) $((1+ 2)) ) 
+               x=$(\echo $(\true >&3 ) $((1+ 2)) ) 
        } 
        function reread_COMSUB_EXPRSUB { x=$((
                echo $(true >&3) $((1+ 2))
        )|tr u x); }
        function reread_COMSUB_EXPRSUB {
-               x=$(( echo $(true >&3 ) $((1+ 2)) ) | tr u x ) 
+               x=$( ( \echo $(\true >&3 ) $((1+ 2)) ) | \tr u x ) 
        } 
 ---
 name: funsub-1