(command.CommandList
  children: [
    (command.Simple
      blame_tok: <Id.Lit_Colon ':'>
      more_env: []
      words: [
        {<Id.Lit_Colon ':'>}
        {<Id.Lit_Colon ':'>}
        {<generated>}
        {<by>}
        {<mkptytests>}
        {<from>}
        {(DQ <'posix-sh-*-c.pty'>)}
        {<Id.Lit_Colon ':'>}
        {<Id.Lit_Colon ':'>}
      ]
      redirects: []
      do_fork: T
    )
    (command.ShFunction
      keyword: <Id.KW_Function function>
      name_tok: <err_exit>
      name: err_exit
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <print>
              more_env: []
              words: [{<print>} {<-u2>} {<-n>} {(DQ <Id.Lit_BadBackslash '\\'> <t>)}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <print>
              more_env: []
              words: [
                {<print>}
                {<-u2>}
                {<-r>}
                {(${ Id.VSub_Name Command) <Id.Lit_LBracket '['> ($ Id.VSub_Number 1) 
                  <Id.Lit_RBracket ']'> <Id.Lit_Colon ':'>
                }
                {
                  (DQ 
                    (BracedVarSub
                      left: <Id.Left_DollarBrace '${'>
                      token: <Id.VSub_At '@'>
                      var_name: '@'
                      suffix_op: (suffix_op.Slice begin:{<Id.Lit_Digits 2>})
                      right: <Id.Arith_RBrace _>
                    )
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.DParen
              left: <Id.Op_DLeftParen _>
              child: 
                (arith_expr.UnaryAssign
                  op_id: Id.Node_PostDPlus
                  child: ($ Id.Lit_ArithVarLike Errors)
                )
              right: <Id.Op_DRightParen _>
              redirects: []
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <alias>
      more_env: []
      words: [{<alias>} {<Id.Lit_VarLike 'err_exit='> (SQ <'err_exit $lineno'>)}]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'Command='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'Command='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'Command='> name:Command)
          op: assign_op.Equal
          rhs: 
            {
              (BracedVarSub
                left: <Id.Left_DollarBrace '${'>
                token: <Id.VSub_Number 0>
                var_name: 0
                suffix_op: 
                  (suffix_op.Unary
                    op: <Id.VOp1_DPound '##'>
                    arg_word: {<Id.Lit_Other '*'> <Id.Lit_Slash '/'>}
                  )
                right: <Id.Right_DollarBrace '}'>
              )
            }
        )
      ]
      redirects: []
    )
    (command.Simple
      blame_tok: <integer>
      more_env: []
      words: [{<integer>} {<Id.Lit_VarLike 'Errors='> <0>} {<Id.Lit_VarLike 'lineno='> <1>}]
      redirects: []
      do_fork: T
    )
    (command.AndOr
      children: [
        (command.Simple
          blame_tok: <whence>
          more_env: []
          words: [{<whence>} {<-q>} {<pty>}]
          redirects: []
          do_fork: T
        )
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Sentence
              child: 
                (command.ShAssignment
                  left: <Id.Lit_VarLike 'lineno='>
                  pairs: [
                    (AssignPair
                      left: <Id.Lit_VarLike 'lineno='>
                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'lineno='> name:lineno)
                      op: assign_op.Equal
                      rhs: {($ Id.VSub_DollarName LINENO)}
                    )
                  ]
                  redirects: []
                )
              terminator: <Id.Op_Semi _>
            )
            (command.Sentence
              child: 
                (command.Simple
                  blame_tok: <err_exit>
                  more_env: []
                  words: [{<err_exit>} {(DQ <'pty command not found -- tests skipped'>)}]
                  redirects: []
                  do_fork: T
                )
              terminator: <Id.Op_Semi _>
            )
            (command.Sentence
              child: (command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<0>})
              terminator: <Id.Op_Semi _>
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
      ]
      ops: [<Id.Op_DPipe _>]
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'bintrue='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'bintrue='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'bintrue='> name:bintrue)
          op: assign_op.Equal
          rhs: 
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <whence>
                    more_env: []
                    words: [{<whence>} {<-p>} {<true>}]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'x='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'x='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'x='> name:x)
          op: assign_op.Equal
          rhs: 
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <Id.VSub_DollarName '$SHELL'>
                    more_env: []
                    words: [{($ Id.VSub_DollarName SHELL)}]
                    redirects: [
                      (Redir
                        op: <Id.Redir_DLessDash '<<-'>
                        loc: (redir_loc.Fd fd:0)
                        arg: 
                          (redir_param.HereDoc
                            here_begin: 
                              {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\E'> ch:E) <OF>}
                            here_end_tok: <Id.Undefined_Tok ''>
                            stdin_parts: [
                              <'trap \'exit 0\' EXIT\n'>
                              <'bintrue=$(whence -p true)\n'>
                              <'set -o monitor\n'>
                              <'{\n'>
                              <'eval $\'set -o vi\\npty $bintrue\'\n'>
                              <'} < /dev/null & pid=$!\n'>
                              <'#sleep 1\n'>
                              <'jobs\n'>
                              <'kill $$\n'>
                            ]
                          )
                      )
                    ]
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (command.AndOr
      children: [
        (command.DBracket
          left: <Id.KW_DLeftBracket '[['>
          expr: 
            (bool_expr.Binary
              op_id: Id.BoolBinary_GlobDEqual
              left: {($ Id.VSub_DollarName x)}
              right: {<Id.Lit_Other '*'> <Stop> <Id.Lit_Other '*'>}
            )
          right: <Id.Lit_DRightBracket ']]'>
          redirects: []
        )
        (command.Simple
          blame_tok: <err_exit>
          more_env: []
          words: [{<err_exit>} {(SQ <'monitor mode enabled incorrectly causes job to stop'>)}]
          redirects: []
          do_fork: T
        )
      ]
      ops: [<Id.Op_DAmp _>]
    )
    (command.If
      if_kw: <Id.KW_If if>
      arms: [
        (IfArm
          keyword: <Id.KW_If if>
          cond: 
            (condition.Shell
              commands: [
                (command.DBracket
                  left: <Id.KW_DLeftBracket '[['>
                  expr: (bool_expr.Unary op_id:Id.BoolUnary_o child:{<xtrace>})
                  right: <Id.Lit_DRightBracket ']]'>
                  redirects: []
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'debug='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'debug='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'debug='> name:debug)
                  op: assign_op.Equal
                  rhs: {<--debug> <Id.Lit_Equals '='> <1>}
                )
              ]
              redirects: []
            )
          ]
          spids: [245 255]
        )
      ]
      else_kw: <Id.KW_Else else>
      else_action: [
        (command.ShAssignment
          left: <Id.Lit_VarLike 'debug='>
          pairs: [
            (AssignPair
              left: <Id.Lit_VarLike 'debug='>
              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'debug='> name:debug)
              op: assign_op.Equal
              rhs: (rhs_word__Empty)
            )
          ]
          redirects: []
        )
      ]
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
    (command.ShFunction
      keyword: <Id.KW_Function function>
      name_tok: <tst>
      name: tst
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Simple
              blame_tok: <integer>
              more_env: []
              words: [{<integer>} {<Id.Lit_VarLike 'lineno='> ($ Id.VSub_Number 1)} {<offset>}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <typeset>
              more_env: []
              words: [{<typeset>} {<text>}]
              redirects: []
              do_fork: T
            )
            (command.Pipeline
              children: [
                (command.Simple
                  blame_tok: <pty>
                  more_env: []
                  words: [
                    {<pty>}
                    {($ Id.VSub_DollarName debug)}
                    {<--dialogue>}
                    {<--messages> <Id.Lit_Equals '='> (SQ <'/dev/fd/1'>)}
                    {($ Id.VSub_DollarName SHELL)}
                  ]
                  redirects: []
                  do_fork: T
                )
                (command.WhileUntil
                  keyword: <Id.KW_While while>
                  cond: 
                    (condition.Shell
                      commands: [
                        (command.Simple
                          blame_tok: <read>
                          more_env: []
                          words: [{<read>} {<-r>} {<text>}]
                          redirects: []
                          do_fork: T
                        )
                      ]
                    )
                  body: 
                    (command.DoGroup
                      left: <Id.KW_Do do>
                      children: [
                        (command.If
                          if_kw: <Id.KW_If if>
                          arms: [
                            (IfArm
                              keyword: <Id.KW_If if>
                              cond: 
                                (condition.Shell
                                  commands: [
                                    (command.DBracket
                                      left: <Id.KW_DLeftBracket '[['>
                                      expr: 
                                        (bool_expr.Binary
                                          op_id: Id.BoolBinary_GlobDEqual
                                          left: {($ Id.VSub_DollarName text)}
                                          right: {<Id.Lit_Other '*'> <debug> <Id.Lit_Other '*'>}
                                        )
                                      right: <Id.Lit_DRightBracket ']]'>
                                      redirects: []
                                    )
                                  ]
                                )
                              then_kw: <Id.KW_Then then>
                              action: [
                                (command.Simple
                                  blame_tok: <print>
                                  more_env: []
                                  words: [
                                    {<print>}
                                    {<-u2>}
                                    {<-r>}
                                    {<-->}
                                    {(DQ ($ Id.VSub_DollarName text))}
                                  ]
                                  redirects: []
                                  do_fork: T
                                )
                              ]
                              spids: [318 333]
                            )
                          ]
                          else_kw: <Id.KW_Else else>
                          else_action: [
                            (command.ShAssignment
                              left: <Id.Lit_VarLike 'offset='>
                              pairs: [
                                (AssignPair
                                  left: <Id.Lit_VarLike 'offset='>
                                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'offset='> name:offset)
                                  op: assign_op.Equal
                                  rhs: 
                                    {
                                      (BracedVarSub
                                        left: <Id.Left_DollarBrace '${'>
                                        token: <Id.VSub_Name text>
                                        var_name: text
                                        suffix_op: 
                                          (suffix_op.PatSub
                                            pat: 
                                              {<Id.Lit_Other '*'> <': line '> 
                                                (word_part.ExtGlob
                                                  op: <Id.ExtGlob_Plus '+('>
                                                  arms: [{<'[[:digit:]]'>}]
                                                  right: <Id.Right_ExtGlob _>
                                                ) <':'> <Id.Lit_Other '*'>
                                              }
                                            replace: 
                                              {
                                                (word_part.EscapedLiteral
                                                  token: <Id.Lit_EscapedChar '\\1'>
                                                  ch: 1
                                                )
                                              }
                                            replace_mode: Id.Undefined_Tok
                                            slash_tok: <Id.VOp2_Slash _>
                                          )
                                        right: <Id.Right_DollarBrace '}'>
                                      )
                                    }
                                )
                              ]
                              redirects: []
                            )
                            (command.Simple
                              blame_tok: <err_exit>
                              more_env: []
                              words: [
                                {<err_exit>}
                                {
                                  (DQ 
                                    (BracedVarSub
                                      left: <Id.Left_DollarBrace '${'>
                                      token: <Id.VSub_Name text>
                                      var_name: text
                                      suffix_op: 
                                        (suffix_op.PatSub
                                          pat: {<': line '> ($ Id.VSub_DollarName offset) <':'>}
                                          replace: 
                                            {<': line '> 
                                              (word_part.ArithSub
                                                left: <Id.Left_DollarDParen '$(('>
                                                anode: 
                                                  (arith_expr.Binary
                                                    op_id: Id.Arith_Plus
                                                    left: ($ Id.Lit_ArithVarLike lineno)
                                                    right: ($ Id.Lit_ArithVarLike offset)
                                                  )
                                                right: <Id.Right_DollarDParen _>
                                              ) <':'>
                                            }
                                          replace_mode: Id.Undefined_Tok
                                          slash_tok: <Id.VOp2_Slash _>
                                        )
                                      right: <Id.Right_DollarBrace '}'>
                                    )
                                  )
                                }
                              ]
                              redirects: []
                              do_fork: T
                            )
                          ]
                          fi_kw: <Id.KW_Fi fi>
                          redirects: []
                        )
                      ]
                      right: <Id.KW_Done done>
                    )
                  redirects: []
                )
              ]
              ops: [<Id.Op_Pipe _>]
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <export>
      more_env: []
      words: [
        {<export>}
        {<Id.Lit_VarLike 'PS1='> (SQ <':test-!: '>)}
        {<Id.Lit_VarLike 'PS2='> (SQ <'> '>)}
        {<Id.Lit_VarLike 'PS4='> (SQ <': '>)}
        {<Id.Lit_VarLike 'ENV='>}
        {<Id.Lit_VarLike 'EXINIT='>}
        {<Id.Lit_VarLike 'HISTFILE='>}
        {<Id.Lit_VarLike 'TERM='> <dumb>}
        {<Id.Lit_VarLike 'VISUAL='> <vi>}
        {<Id.Lit_VarLike 'LC_ALL='> <C>}
      ]
      redirects: []
      do_fork: T
    )
    (command.If
      if_kw: <Id.KW_If if>
      arms: [
        (IfArm
          keyword: <Id.KW_If if>
          cond: 
            (condition.Shell
              commands: [
                (command.Pipeline
                  negated: <Id.KW_Bang '!'>
                  children: [
                    (command.Simple
                      blame_tok: <pty>
                      more_env: []
                      words: [{<pty>} {($ Id.VSub_DollarName bintrue)}]
                      redirects: [
                        (Redir
                          op: <Id.Redir_Less '<'>
                          loc: (redir_loc.Fd fd:0)
                          arg: {<'/dev/null'>}
                        )
                      ]
                      do_fork: T
                    )
                  ]
                  ops: []
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.Simple
              blame_tok: <err_exit>
              more_env: []
              words: [
                {<err_exit>}
                {<pty>}
                {<command>}
                {<hangs>}
                {<on>}
                {($ Id.VSub_DollarName bintrue)}
                {<-->}
                {<tests>}
                {<skipped>}
              ]
              redirects: []
              do_fork: T
            )
            (command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<0>})
          ]
          spids: [432 444]
        )
      ]
      else_action: []
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 026(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported:  When the\n'>
                <'# POSIX locale is specified and a background job is suspended by a\n'>
                <'# SIGTSTP signal then the <state> field in the output message is set to\n'>
                <'# Stopped, Suspended, Stopped(SIGTSTP) or Suspended(SIGTSTP).\n'>
                <'\n'>
                <'I ^\\r?\\n$\n'>
                <'p :test-1:\n'>
                <'w sleep 60 &\n'>
                <'u [[:digit:]]\\r?\\n$\n'>
                <'s 100\n'>
                <'p :test-2:\n'>
                <'w kill -TSTP $!\n'>
                <'u (Stopped|Suspended)\n'>
                <'p :test-3:\n'>
                <'w kill -KILL $!\n'>
                <'w wait\n'>
                <'u (Killed|Done)\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 028(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported:  When the\n'>
                <'# POSIX locale is specified and a background job is suspended by a\n'>
                <'# SIGTTIN signal then the <state> field in the output message is set to\n'>
                <'# Stopped(SIGTTIN) or Suspended(SIGTTIN).\n'>
                <'\n'>
                <'I ^\\r?\\n$\n'>
                <'p :test-1:\n'>
                <'w sleep 60 &\n'>
                <'u [[:digit:]]\\r?\\n$\n'>
                <'s 100\n'>
                <'p :test-2:\n'>
                <'w kill -TTIN $!\n'>
                <'u (Stopped|Suspended) \\(SIGTTIN\\)\n'>
                <'p :test-3:\n'>
                <'w kill -KILL $!\n'>
                <'w wait\n'>
                <'u (Killed|Done)\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 029(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported:  When the\n'>
                <'# POSIX locale is specified and a background job is suspended by a\n'>
                <'# SIGTTOU signal then the <state> field in the output message is set to\n'>
                <'# Stopped(SIGTTOU) or Suspended(SIGTTOU).\n'>
                <'\n'>
                <'I ^\\r?\\n$\n'>
                <'p :test-1:\n'>
                <'w sleep 60 &\n'>
                <'u [[:digit:]]\\r?\\n$\n'>
                <'s 100\n'>
                <'p :test-2:\n'>
                <'w kill -TTOU $!\n'>
                <'u (Stopped|Suspended) \\(SIGTTOU\\)\n'>
                <'p :test-3:\n'>
                <'w kill -KILL $!\n'>
                <'w wait\n'>
                <'u (Killed|Done)\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 091(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported and shell\n'>
                <'# command line editing is supported:  When in insert mode an entered\n'>
                <'# character other than <newline>, erase, interrupt, kill, control-V,\n'>
                <'# control-W, backslash \\ (followed by erase or kill), end-of-file and\n'>
                <'# <ESC> is inserted in the current command line.\n'>
                <'\n'>
                <'c echo h\n'>
                <'c ell\n'>
                <'w o\n'>
                <'u ^hello\\r?\\n$\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 093(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported and shell\n'>
                <'# command line editing is supported:  After termination of a previous\n'>
                <'# command, sh is entered in insert mode.\n'>
                <'\n'>
                <'w echo hello\n'>
                <'u ^hello\\r?\\n$\n'>
                <'c echo goo\n'>
                <'c dby\n'>
                <'w e\n'>
                <'u ^goodbye\\r?\\n$\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 094(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported and shell\n'>
                <'# command line editing is supported:  When in insert mode an <ESC>\n'>
                <'# switches sh into command mode.\n'>
                <'\n'>
                <'c echo he\\E\n'>
                <'s 400\n'>
                <'w allo\n'>
                <'u ^hello\\r?\\n$\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 096(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported and shell\n'>
                <'# command line editing is supported:  When in command mode the\n'>
                <'# interrupt character causes sh to terminate command line editing on\n'>
                <'# the current command line, re-issue the prompt on the next line of the\n'>
                <'# terminal and to reset the command history so that the command that\n'>
                <'# was interrupted is not entered in the history.\n'>
                <'\n'>
                <'I ^\\r?\\n$\n'>
                <'p :test-1:\n'>
                <'w echo first\n'>
                <'p :test-2:\n'>
                <'w stty intr ^C\n'>
                <'p :test-3:\n'>
                <'c echo bad\\E\n'>
                <'s 400\n'>
                <'c \\cC\n'>
                <'w echo scrambled\n'>
                <'p :test-4:\n'>
                <'w history\n'>
                <'u echo first\n'>
                <'r stty intr \\^C\n'>
                <'r echo\n'>
                <'r history\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 097(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported and shell\n'>
                <'# command line editing is supported:  When in insert mode a <newline>\n'>
                <'# causes the current command line to be executed.\n'>
                <'\n'>
                <'c echo ok\\n\n'>
                <'u ^ok\\r?\\n$\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 099(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported and shell\n'>
                <'# command line editing is supported:  When in insert mode the interrupt\n'>
                <'# character causes sh to terminate command line editing on the current\n'>
                <'# command line, re-issue the prompt on the next line of the terminal\n'>
                <'# and to reset the command history so that the command that was\n'>
                <'# interrupted is not entered in the history.\n'>
                <'\n'>
                <'I ^\\r?\\n$\n'>
                <'p :test-1:\n'>
                <'w echo first\n'>
                <'u ^first\n'>
                <'p :test-2:\n'>
                <'w stty intr ^C\n'>
                <'r\n'>
                <'p :test-3:\n'>
                <'c echo bad\\cC\n'>
                <'w echo last\n'>
                <'p :test-4:\n'>
                <'w history\n'>
                <'u echo first\n'>
                <'r stty intr \\^C\n'>
                <'r echo last\n'>
                <'r history\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 100(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported and shell\n'>
                <'# command line editing is supported:  When in insert mode the kill\n'>
                <'# character clears all the characters from the input line.\n'>
                <'\n'>
                <'p :test-1:\n'>
                <'w stty kill ^X\n'>
                <'p :test-2:\n'>
                <'c echo bad\\cX\n'>
                <'w echo ok\n'>
                <'u ^ok\\r?\\n$\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 101(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported and shell\n'>
                <'# command line editing is supported:  When in insert mode a control-V\n'>
                <'# causes the next character to be inserted even in the case that the\n'>
                <'# character is a special insert mode character.\n'>
                <'# Testing Requirements: The assertion must be tested with at least the\n'>
                <'# following set of characters: <newline>, erase, interrupt, kill,\n'>
                <'# control-V, control-W, end-of-file, backslash \\ (followed by erase or\n'>
                <'# kill) and <ESC>.\n'>
                <'\n'>
                <'d 10\n'>
                <'p :test-1:\n'>
                <'w stty erase ^H intr ^C kill ^X\n'>
                <'p :test-2:\n'>
                <'w echo erase=:\\cV\\cH:\n'>
                <'u ^erase=:\\r?\\n$\n'>
                <'p :test-3:\n'>
                <'w echo kill=:\\cV\\cX:\n'>
                <'u ^kill=:\\cX:\\r?\\n$\n'>
                <'p :test-4:\n'>
                <'w echo control-V=:\\cV\\cV:\n'>
                <'u ^control-V=:\\cV:\\r?\\n$\n'>
                <'p :test-5:\n'>
                <'w echo control-W:\\cV\\cW:\n'>
                <'u ^control-W:\\cW:\\r?\\n$\n'>
                <'p :test-6:\n'>
                <'w echo EOF=:\\cV\\cD:\n'>
                <'u ^EOF=:\\004:\\r?\\n$\n'>
                <'p :test-7:\n'>
                <'w echo backslash-erase=:\\\\\\cH:\n'>
                <'u ^backslash-erase=:\\r?\\n$\n'>
                <'p :test-8:\n'>
                <'w echo backslash-kill=:\\\\\\cX:\n'>
                <'u ^backslash-kill=:\\cX:\\r?\\n$\n'>
                <'p :test-9:\n'>
                <'w echo ESC=:\\cV\\E:\n'>
                <'u ^ESC=:\\E:\\r?\\n$\n'>
                <'p :test-10:\n'>
                <'w echo interrupt=:\\cV\\cC:\n'>
                <'u ^interrupt=:\\cC:\\r?\\n$\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 104(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported and shell\n'>
                <'# command line editing is supported:  When in insert mode an\n'>
                <'# end-of-file at the beginning of an input line is interpreted as the\n'>
                <'# end of input.\n'>
                <'\n'>
                <'p :test-1:\n'>
                <'w trap \'echo done >&2\' EXIT\n'>
                <'p :test-2:\n'>
                <'s 100\n'>
                <'c \\cD\n'>
                <'u ^done\\r?\\n$\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 111(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported and shell\n'>
                <'# command line editing is supported:  When in command mode, # inserts\n'>
                <'# the character # at the beginning of the command line and causes the\n'>
                <'# line to be treated as a comment and the line is entered in the\n'>
                <'# command history.\n'>
                <'\n'>
                <'p :test-1:\n'>
                <'c echo save\\E\n'>
                <'s 400\n'>
                <'c #\n'>
                <'p :test-2:\n'>
                <'w history\n'>
                <'u #echo save\n'>
                <'r history\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 137(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported and shell\n'>
                <'# command line editing is supported: When in command mode, then v\n'>
                <'# invokes the vi editor to edit the current command line in a temporary\n'>
                <'# file. When the editor exits, the commands in the temporary file are\n'>
                <'# executed.\n'>
                <'\n'>
                <'p :test-1:\n'>
                <'c echo hello\\E\n'>
                <'s 400\n'>
                <'c v\n'>
                <'u /tmp/\n'>
                <'c A world\\E\n'>
                <'s 400\n'>
                <'w :wq\n'>
                <'u ^hello world\\r?\\n$\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.Simple
      blame_tok: <tst>
      more_env: []
      words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <'!'>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'L POSIX sh 251(C)\n'>
                <'\n'>
                <'# If the User Portability Utilities Option is supported and shell\n'>
                <'# command line editing is supported:  When in command mode, then the\n'>
                <'# command N repeats the most recent / or ? command, reversing the\n'>
                <'# direction of the search.\n'>
                <'\n'>
                <'p :test-1:\n'>
                <'w echo repeat-1\n'>
                <'u ^repeat-1\\r?\\n$\n'>
                <'p :test-2:\n'>
                <'w echo repeat-2\n'>
                <'u ^repeat-2\\r?\\n$\n'>
                <'p :test-3:\n'>
                <'s 100\n'>
                <'c \\E\n'>
                <'s 400\n'>
                <'w /rep\n'>
                <'u echo repeat-2\n'>
                <'c n\n'>
                <'r echo repeat-1\n'>
                <'c N\n'>
                <'r echo repeat-2\n'>
                <'w dd\n'>
                <'p :test-3:\n'>
                <'w echo repeat-3\n'>
                <'u ^repeat-3\\r?\\n$\n'>
                <'p :test-4:\n'>
                <'s 100\n'>
                <'c \\E\n'>
                <'s 400\n'>
                <'w ?rep\n'>
                <'r echo repeat-2\n'>
                <'c N\n'>
                <'r echo repeat-1\n'>
                <'c n\n'>
                <'r echo repeat-2\n'>
                <'c n\n'>
                <'r echo repeat-3\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.AndOr
      children: [
        (command.Simple
          blame_tok: <whence>
          more_env: []
          words: [{<whence>} {<-q>} {<less>}]
          redirects: []
          do_fork: T
        )
        (command.Simple
          blame_tok: <tst>
          more_env: [(EnvPair left:<Id.Lit_VarLike 'TERM='> name:TERM val:{<vt100>})]
          words: [{<tst>} {($ Id.VSub_DollarName LINENO)}]
          redirects: [
            (Redir
              op: <Id.Redir_DLess '<<'>
              loc: (redir_loc.Fd fd:0)
              arg: 
                (redir_param.HereDoc
                  here_begin: {(DQ <'!'>)}
                  here_end_tok: <Id.Undefined_Tok ''>
                  stdin_parts: [
                    <'L process/terminal group exercise\n'>
                    <'\n'>
                    <'w m=yes; while true; do echo $m-$m; done | less\n'>
                    <'u :$|:\\E|lines\n'>
                    <'c \\cZ\n'>
                    <'r Stopped\n'>
                    <'w fg\n'>
                    <'u yes-yes\n'>
                  ]
                )
            )
          ]
          do_fork: T
        )
      ]
      ops: [<Id.Op_DAmp _>]
    )
    (command.ControlFlow
      keyword: <Id.ControlFlow_Exit exit>
      arg_word: 
        {
          (word_part.ArithSub
            left: <Id.Left_DollarDParen '$(('>
            anode: 
              (arith_expr.TernaryOp
                cond: 
                  (arith_expr.Binary
                    op_id: Id.Arith_Less
                    left: ($ Id.Lit_ArithVarLike Errors)
                    right: {<Id.Lit_Digits 125>}
                  )
                true_expr: ($ Id.Lit_ArithVarLike Errors)
                false_expr: {<Id.Lit_Digits 125>}
              )
            right: <Id.Right_DollarDParen _>
          )
        }
    )
  ]
)