(command.CommandList
  children: [
    (C {<typeset>} {<-i>} {<Id.Lit_VarLike 'rc='> <0>})
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SH_PROG)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: <Id.VSub_Name SH_PROG>
                suffix_op: 
                  (suffix_op.Unary
                    tok: <Id.VTest_ColonHyphen ':-'>
                    arg_word: {($ Id.VSub_DollarName '$SHELL')}
                  )
              )
            }
          spids: [10]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:SH_PROG)
          op: assign_op.Equal
          rhs: 
            {
              (braced_var_sub
                token: <Id.VSub_Name SH_PROG>
                suffix_op: (suffix_op.Unary tok:<Id.VTest_ColonHyphen ':-'> arg_word:{<bash>})
              )
            }
          spids: [17]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:bash_loc)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {($ Id.VSub_DollarName '$SH_PROG')} {<-c>} {(SQ <'echo ${SHELL}'>)})
              )
            }
          spids: [24]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:rc)
          op: assign_op.Equal
          rhs: {($ Id.VSub_QMark '$?')}
          spids: [35]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DParen
                      child: 
                        (arith_expr.Binary
                          op_id: Id.Arith_NEqual
                          left: <Id.Lit_ArithVarLike rc>
                          right: {<Id.Lit_Digits 0>}
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'Something went wrong in getting '> 
                    (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'SHELL for '> ($ Id.VSub_DollarName '$SH_PROG')
                  )
                }
              ]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.ControlFlow
              token: <Id.ControlFlow_Exit exit>
              arg_word: {($ Id.VSub_DollarName '$rc')}
            )
          ]
          spids: [38 53]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Sentence
                  child: 
                    (command.DBracket
                      expr: 
                        (bool_expr.Unary
                          op_id: Id.BoolUnary_z
                          child: {($ Id.VSub_DollarName '$bash_loc')}
                        )
                    )
                  terminator: <Id.Op_Semi _>
                )
              ]
            )
          action: [
            (command.Simple
              words: [
                {<echo>}
                {
                  (DQ <'Something went wrong in setting bash location from '> 
                    (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\$'>) <'SHELL for '> ($ Id.VSub_DollarName '$SH_PROG')
                  )
                }
              ]
              redirects: [(redir op:<Id.Redir_GreatAnd '>&'> loc:(redir_loc.Fd fd:1) arg:{<2>})]
              do_fork: T
            )
            (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<3>})
          ]
          spids: [75 87]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:bashdb_main)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: 
                  (command.Pipeline
                    children: [
                      (C {<strings>} {($ Id.VSub_DollarName '$bash_loc')})
                      (C {<grep>} {<bashdb>})
                    ]
                    negated: F
                  )
              )
            }
          spids: [112]
        )
      ]
    )
    (C {<echo>} 
      {
        (command_sub
          left_token: <Id.Left_DollarParen '$('>
          child: 
            (C {<dirname>} 
              {
                (command_sub
                  left_token: <Id.Left_DollarParen '$('>
                  child: 
                    (C {<dirname>} 
                      {
                        (command_sub
                          left_token: <Id.Left_DollarParen '$('>
                          child: (C {<dirname>} {($ Id.VSub_DollarName '$bashdb_main')})
                        )
                      }
                    )
                )
              }
            )
        )
      }
    )
    (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>})
  ]
)