(command.CommandList
  children: [
    (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.Simple
              blame_tok: <let>
              more_env: []
              words: [{<let>} {<Id.Lit_VarLike 'Errors+='> <1>}]
              redirects: []
              do_fork: T
            )
          ]
          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>}]
      redirects: []
      do_fork: T
    )
    (command.AndOr
      children: [
        (command.ShAssignment
          left: <Id.Lit_VarLike 'tmp='>
          pairs: [
            (AssignPair
              left: <Id.Lit_VarLike 'tmp='>
              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tmp='> name:tmp)
              op: assign_op.Equal
              rhs: 
                {
                  (CommandSub
                    left_token: <Id.Left_DollarParen '$('>
                    child: 
                      (command.Simple
                        blame_tok: <mktemp>
                        more_env: []
                        words: [{<mktemp>} {<-dt>}]
                        redirects: []
                        do_fork: T
                      )
                    right: <Id.Eof_RParen _>
                  )
                }
            )
          ]
          redirects: []
        )
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Sentence
              child: 
                (command.Simple
                  blame_tok: <err_exit>
                  more_env: []
                  words: [{<err_exit>} {<mktemp>} {<-dt>} {<failed>}]
                  redirects: []
                  do_fork: T
                )
              terminator: <Id.Op_Semi _>
            )
            (command.Sentence
              child: (command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<1>})
              terminator: <Id.Op_Semi _>
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
      ]
      ops: [<Id.Op_DPipe _>]
    )
    (command.Simple
      blame_tok: <trap>
      more_env: []
      words: [{<trap>} {(DQ <'cd /; rm -rf '> ($ Id.VSub_DollarName tmp))} {<EXIT>}]
      redirects: []
      do_fork: T
    )
    (command.ShFunction
      keyword: <Id.KW_Function function>
      name_tok: <abspath>
      name: abspath
      body: 
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.ShAssignment
              left: <Id.Lit_VarLike 'base='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'base='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'base='> name:base)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (CommandSub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Simple
                            blame_tok: <basename>
                            more_env: []
                            words: [{<basename>} {($ Id.VSub_DollarName SHELL)}]
                            redirects: []
                            do_fork: T
                          )
                        right: <Id.Eof_RParen _>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <cd>
              more_env: []
              words: [
                {<cd>}
                {
                  (BracedVarSub
                    left: <Id.Left_DollarBrace '${'>
                    token: <Id.VSub_Name SHELL>
                    var_name: SHELL
                    suffix_op: 
                      (suffix_op.Unary
                        op: <Id.VOp1_Percent '%'>
                        arg_word: {<Id.Lit_Slash '/'> ($ Id.VSub_DollarName base)}
                      )
                    right: <Id.Right_DollarBrace '}'>
                  )
                }
              ]
              redirects: []
              do_fork: T
            )
            (command.ShAssignment
              left: <Id.Lit_VarLike 'newdir='>
              pairs: [
                (AssignPair
                  left: <Id.Lit_VarLike 'newdir='>
                  lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'newdir='> name:newdir)
                  op: assign_op.Equal
                  rhs: 
                    {
                      (CommandSub
                        left_token: <Id.Left_DollarParen '$('>
                        child: 
                          (command.Simple
                            blame_tok: <pwd>
                            more_env: []
                            words: [{<pwd>}]
                            redirects: []
                            do_fork: T
                          )
                        right: <Id.Eof_RParen _>
                      )
                    }
                )
              ]
              redirects: []
            )
            (command.Simple
              blame_tok: <cd>
              more_env: []
              words: [{<cd>} {(word_part.TildeSub token:<Id.Lit_TildeLike '~-'> user_name:-)}]
              redirects: []
              do_fork: T
            )
            (command.Simple
              blame_tok: <print>
              more_env: []
              words: [{<print>} {($ Id.VSub_DollarName newdir) <'/'> ($ Id.VSub_DollarName base)}]
              redirects: []
              do_fork: T
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
    )
    (command.Simple
      blame_tok: <builtin>
      more_env: []
      words: [{<builtin>} {<getconf>}]
      redirects: []
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'ABSHELL='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'ABSHELL='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'ABSHELL='> name:ABSHELL)
          op: assign_op.Equal
          rhs: 
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <abspath>
                    more_env: []
                    words: [{<abspath>}]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (command.AndOr
      children: [
        (command.Simple
          blame_tok: <cd>
          more_env: []
          words: [{<cd>} {($ Id.VSub_DollarName tmp)}]
          redirects: []
          do_fork: T
        )
        (BraceGroup
          left: <Id.Lit_LBrace '{'>
          children: [
            (command.Sentence
              child: 
                (command.Simple
                  blame_tok: <err_exit>
                  more_env: []
                  words: [{<err_exit>} {(DQ <'cd '> ($ Id.VSub_DollarName tmp) <' failed'>)}]
                  redirects: []
                  do_fork: T
                )
              terminator: <Id.Op_Semi _>
            )
            (command.Sentence
              child: (command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<1>})
              terminator: <Id.Op_Semi _>
            )
          ]
          redirects: []
          right: <Id.Lit_RBrace '}'>
        )
      ]
      ops: [<Id.Op_DPipe _>]
    )
    (command.Simple
      blame_tok: <print>
      more_env: []
      words: [{<print>} {<Id.ControlFlow_Exit exit>} {<0>}]
      redirects: [(Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<.profile>})]
      do_fork: T
    )
    (command.Simple
      blame_tok: <Id.Left_DollarBrace '${'>
      more_env: []
      words: [{(${ Id.VSub_Name ABSHELL)}]
      redirects: [
        (Redir
          op: <Id.Redir_DLess '<<'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {<Id.KW_Bang '!'>}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'HOME='>
                ($ Id.VSub_DollarName PWD)
                <' '>
                <'PATH='>
                ($ Id.VSub_DollarName PATH)
                <' '>
                <'SHELL='>
                ($ Id.VSub_DollarName ABSSHELL)
                <' '>
                (CommandSub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (command.CommandList
                      children: [
                        (command.ShAssignment
                          left: <Id.Lit_VarLike 'v='>
                          pairs: [
                            (AssignPair
                              left: <Id.Lit_VarLike 'v='>
                              lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'v='> name:v)
                              op: assign_op.Equal
                              rhs: 
                                {
                                  (CommandSub
                                    left_token: <Id.Left_DollarParen '$('>
                                    child: 
                                      (command.Simple
                                        blame_tok: <getconf>
                                        more_env: []
                                        words: [{<getconf>} {<LIBPATH>}]
                                        redirects: []
                                        do_fork: T
                                      )
                                    right: <Id.Eof_RParen _>
                                  )
                                }
                            )
                          ]
                          redirects: []
                        )
                        (command.ForEach
                          keyword: <Id.KW_For for>
                          iter_names: [v]
                          iterable: 
                            (for_iter.Words
                              words: [
                                {
                                  (BracedVarSub
                                    left: <Id.Left_DollarBrace '${'>
                                    token: <Id.VSub_Name v>
                                    var_name: v
                                    suffix_op: 
                                      (suffix_op.PatSub
                                        pat: {<','>}
                                        replace: {<' '>}
                                        replace_mode: Id.Lit_Slash
                                        slash_tok: <Id.VOp2_Slash _>
                                      )
                                    right: <Id.Right_DollarBrace '}'>
                                  )
                                }
                              ]
                            )
                          body: 
                            (command.DoGroup
                              left: <Id.KW_Do do>
                              children: [
                                (command.ShAssignment
                                  left: <Id.Lit_VarLike 'v='>
                                  pairs: [
                                    (AssignPair
                                      left: <Id.Lit_VarLike 'v='>
                                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'v='> name:v)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (BracedVarSub
                                            left: <Id.Left_DollarBrace '${'>
                                            token: <Id.VSub_Name v>
                                            var_name: v
                                            suffix_op: 
                                              (suffix_op.Unary
                                                op: <Id.VOp1_Pound '#'>
                                                arg_word: {<Id.Lit_Other '*'> <':'>}
                                              )
                                            right: <Id.Right_DollarBrace '}'>
                                          )
                                        }
                                    )
                                  ]
                                  redirects: []
                                )
                                (command.ShAssignment
                                  left: <Id.Lit_VarLike 'v='>
                                  pairs: [
                                    (AssignPair
                                      left: <Id.Lit_VarLike 'v='>
                                      lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'v='> name:v)
                                      op: assign_op.Equal
                                      rhs: 
                                        {
                                          (BracedVarSub
                                            left: <Id.Left_DollarBrace '${'>
                                            token: <Id.VSub_Name v>
                                            var_name: v
                                            suffix_op: 
                                              (suffix_op.Unary
                                                op: <Id.VOp1_DPercent '%%'>
                                                arg_word: {<':'> <Id.Lit_Other '*'>}
                                              )
                                            right: <Id.Right_DollarBrace '}'>
                                          )
                                        }
                                    )
                                  ]
                                  redirects: []
                                )
                                (command.AndOr
                                  children: [
                                    (command.Simple
                                      blame_tok: <eval>
                                      more_env: []
                                      words: [
                                        {<eval>}
                                        {<Id.KW_DLeftBracket '[['>}
                                        {
                                          (word_part.EscapedLiteral
                                            token: <Id.Lit_EscapedChar '\\$'>
                                            ch: '$'
                                          ) ($ Id.VSub_DollarName v)
                                        }
                                        {<Id.Lit_RBracket ']'> <Id.Lit_RBracket ']'>}
                                      ]
                                      redirects: []
                                      do_fork: T
                                    )
                                    (command.Simple
                                      blame_tok: <eval>
                                      more_env: []
                                      words: [
                                        {<eval>}
                                        {<print>}
                                        {<-n>}
                                        {
                                          (word_part.EscapedLiteral
                                            token: <Id.Lit_EscapedChar '\\"'>
                                            ch: '"'
                                          )
                                        }
                                        {
                                          (word_part.EscapedLiteral
                                            token: <Id.Lit_EscapedChar '\\"'>
                                            ch: '"'
                                          ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'> ch:'$') <Id.Lit_VarLike 'v='> 
                                          (word_part.EscapedLiteral
                                            token: <Id.Lit_EscapedChar '\\"'>
                                            ch: '"'
                                          ) (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'> ch:'$') ($ Id.VSub_DollarName v) 
                                          (word_part.EscapedLiteral
                                            token: <Id.Lit_EscapedChar '\\"'>
                                            ch: '"'
                                          )
                                        }
                                      ]
                                      redirects: []
                                      do_fork: T
                                    )
                                  ]
                                  ops: [<Id.Op_DAmp _>]
                                )
                              ]
                              right: <Id.KW_Done done>
                            )
                          redirects: []
                        )
                      ]
                    )
                  right: <Id.Eof_RParen _>
                )
                <' '>
                <'exec -c -a -ksh '>
                (${ Id.VSub_Name ABSHELL)
                <' -c '>
                <Id.Right_DoubleQuote '"'>
                <'exit 1'>
                <Id.Right_DoubleQuote '"'>
                <' 1>/dev/null 2>&1\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (command.ShAssignment
      left: <Id.Lit_VarLike 'status='>
      pairs: [
        (AssignPair
          left: <Id.Lit_VarLike 'status='>
          lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'status='> name:status)
          op: assign_op.Equal
          rhs: 
            {
              (CommandSub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Simple
                    blame_tok: <echo>
                    more_env: []
                    words: [{<echo>} {($ Id.VSub_QMark '?')}]
                    redirects: []
                    do_fork: T
                  )
                right: <Id.Eof_RParen _>
              )
            }
        )
      ]
      redirects: []
    )
    (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.LogicalAnd
                      left: (bool_expr.Unary op_id:Id.BoolUnary_o child:{<noprivileged>})
                      right: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_GlobNEqual
                          left: {($ Id.VSub_DollarName status)}
                          right: {<0>}
                        )
                    )
                  right: <Id.Lit_DRightBracket ']]'>
                  redirects: []
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.Simple
              blame_tok: <err_exit>
              more_env: []
              words: [{<err_exit>} {(SQ <'exit in .profile is ignored'>)}]
              redirects: []
              do_fork: T
            )
          ]
          spids: [372 390]
        )
        (IfArm
          keyword: <Id.KW_Elif elif>
          cond: 
            (condition.Shell
              commands: [
                (command.DBracket
                  left: <Id.KW_DLeftBracket '[['>
                  expr: 
                    (bool_expr.LogicalAnd
                      left: (bool_expr.Unary op_id:Id.BoolUnary_o child:{<privileged>})
                      right: 
                        (bool_expr.Binary
                          op_id: Id.BoolBinary_GlobDEqual
                          left: {($ Id.VSub_DollarName status)}
                          right: {<0>}
                        )
                    )
                  right: <Id.Lit_DRightBracket ']]'>
                  redirects: []
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.Simple
              blame_tok: <err_exit>
              more_env: []
              words: [{<err_exit>} {(SQ <'privileged .profile not ignored'>)}]
              redirects: []
              do_fork: T
            )
          ]
          spids: [398 416]
        )
      ]
      else_action: []
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
    (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_GlobNEqual
                      left: 
                        {
                          (CommandSub
                            left_token: <Id.Left_DollarParen '$('>
                            child: 
                              (command.CommandList
                                children: [
                                  (command.Sentence
                                    child: 
                                      (command.Simple
                                        blame_tok: <trap>
                                        more_env: []
                                        words: [
                                          {<trap>}
                                          {(SQ <'code=$?; echo $code; trap 0; exit $code'>)}
                                          {<0>}
                                        ]
                                        redirects: []
                                        do_fork: T
                                      )
                                    terminator: <Id.Op_Semi _>
                                  )
                                  (command.ControlFlow
                                    keyword: <Id.ControlFlow_Exit exit>
                                    arg_word: {<123>}
                                  )
                                ]
                              )
                            right: <Id.Eof_RParen _>
                          )
                        }
                      right: {<123>}
                    )
                  right: <Id.Lit_DRightBracket ']]'>
                  redirects: []
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.Simple
              blame_tok: <err_exit>
              more_env: []
              words: [{<err_exit>} {(SQ <'exit not setting $?'>)}]
              redirects: []
              do_fork: T
            )
          ]
          spids: [426 451]
        )
      ]
      else_action: []
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
    (command.Simple
      blame_tok: <cat>
      more_env: []
      words: [{<cat>}]
      redirects: [
        (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<run.sh>})
        (Redir
          op: <Id.Redir_DLessDash '<<-'>
          loc: (redir_loc.Fd fd:0)
          arg: 
            (redir_param.HereDoc
              here_begin: {(DQ <EOF>)}
              here_end_tok: <Id.Undefined_Tok ''>
              stdin_parts: [
                <'trap \'code=$?; echo $code; trap 0; exit $code\' 0\n'>
                <'( trap 0; exit 123 )\n'>
              ]
            )
        )
      ]
      do_fork: T
    )
    (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_GlobNEqual
                      left: 
                        {
                          (CommandSub
                            left_token: <Id.Left_DollarParen '$('>
                            child: 
                              (command.Simple
                                blame_tok: <Id.VSub_DollarName '$SHELL'>
                                more_env: []
                                words: [{($ Id.VSub_DollarName SHELL)} {<'./run.sh'>}]
                                redirects: []
                                do_fork: T
                              )
                            right: <Id.Eof_RParen _>
                          )
                        }
                      right: {<123>}
                    )
                  right: <Id.Lit_DRightBracket ']]'>
                  redirects: []
                )
              ]
            )
          then_kw: <Id.KW_Then then>
          action: [
            (command.Simple
              blame_tok: <err_exit>
              more_env: []
              words: [{<err_exit>} {(SQ <'subshell trap on exit overwrites parent trap'>)}]
              redirects: []
              do_fork: T
            )
          ]
          spids: [476 492]
        )
      ]
      else_action: []
      fi_kw: <Id.KW_Fi fi>
      redirects: []
    )
    (command.AndOr
      children: [
        (command.Simple
          blame_tok: <cd>
          more_env: []
          words: [{<cd>} {(word_part.TildeSub token:<Id.Lit_TildeLike '~-'> user_name:-)}]
          redirects: []
          do_fork: T
        )
        (command.Simple
          blame_tok: <err_exit>
          more_env: []
          words: [{<err_exit>} {(DQ <'cd back failed'>)}]
          redirects: []
          do_fork: T
        )
      ]
      ops: [<Id.Op_DPipe _>]
    )
    (command.AndOr
      children: [
        (command.Simple
          blame_tok: <Id.VSub_DollarName '$SHELL'>
          more_env: []
          words: [
            {($ Id.VSub_DollarName SHELL)}
            {<-c>}
            {(SQ <'builtin -f cmd getconf; getconf --"?-version"; exit 0'>)}
          ]
          redirects: [
            (Redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'/dev/null'>})
            (Redir op:<Id.Redir_GreatAnd '2>&'> loc:(redir_loc.Fd fd:2) arg:{<1>})
          ]
          do_fork: T
        )
        (command.Simple
          blame_tok: <err_exit>
          more_env: []
          words: [
            {<err_exit>}
            {(SQ <'ksh plugin exit failed -- was ksh built with CCFLAGS+=$(CC.EXPORT.DYNAMIC)?'>)}
          ]
          redirects: []
          do_fork: T
        )
      ]
      ops: [<Id.Op_DPipe _>]
    )
    (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 _>
          )
        }
    )
  ]
)