(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: (Token id:Id.VSub_Name val:SH_PROG span_id:12)
                suffix_op: 
                  (suffix_op.Unary
                    op_id: 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: (Token id:Id.VSub_Name val:SH_PROG span_id:19)
                suffix_op: (suffix_op.Unary op_id: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: (Token id:Id.Left_DollarParen val:'$(' span_id:25)
                command_list: 
                  (command.CommandList
                    children: [
                      (C {($ Id.VSub_DollarName '$SH_PROG')} {(-c)} 
                        {(SQ (Token id:Id.Lit_Chars val:'echo ${SHELL}' span_id:31))}
                      )
                    ]
                  )
              )
            }
          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: [
            (command.Sentence
              child: 
                (command.DParen
                  child: 
                    (arith_expr.Binary
                      op_id: Id.Arith_NEqual
                      left: (arith_expr.VarRef token:(Token id:Id.Lit_ArithVarLike val:rc span_id:42))
                      right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)})
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:51)
            )
          ]
          action: [
            (command.Simple
              words: [
                {(echo)}
                {
                  (DQ ('Something went wrong in getting ') 
                    (word_part.EscapedLiteral
                      token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:63)
                    ) ('SHELL for ') ($ Id.VSub_DollarName '$SH_PROG')
                  )
                }
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:58)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:69)
              arg_word: {($ Id.VSub_DollarName '$rc')}
            )
          ]
          spids: [38 53]
        )
      ]
    )
    (command.If
      arms: [
        (if_arm
          cond: [
            (command.Sentence
              child: 
                (command.DBracket
                  expr: 
                    (bool_expr.Unary
                      op_id: Id.BoolUnary_z
                      child: {($ Id.VSub_DollarName '$bash_loc')}
                    )
                )
              terminator: (Token id:Id.Op_Semi val:';' span_id:85)
            )
          ]
          action: [
            (command.Simple
              words: [
                {(echo)}
                {
                  (DQ ('Something went wrong in setting bash location from ') 
                    (word_part.EscapedLiteral
                      token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:97)
                    ) ('SHELL for ') ($ Id.VSub_DollarName '$SH_PROG')
                  )
                }
              ]
              redirects: [
                (redir.Redir
                  op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:92)
                  fd: -1
                  arg_word: {(2)}
                )
              ]
            )
            (command.ControlFlow
              token: (Token id:Id.ControlFlow_Exit val:exit span_id:103)
              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: (Token id:Id.Left_DollarParen val:'$(' span_id:113)
                command_list: 
                  (command.CommandList
                    children: [
                      (command.Pipeline
                        children: [
                          (C {(strings)} {($ Id.VSub_DollarName '$bash_loc')})
                          (C {(grep)} {(bashdb)})
                        ]
                        negated: F
                      )
                    ]
                  )
              )
            }
          spids: [112]
        )
      ]
    )
    (C {(echo)} 
      {
        (command_sub
          left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:128)
          command_list: 
            (command.CommandList
              children: [
                (C {(dirname)} 
                  {
                    (command_sub
                      left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:131)
                      command_list: 
                        (command.CommandList
                          children: [
                            (C {(dirname)} 
                              {
                                (command_sub
                                  left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:134)
                                  command_list: 
                                    (command.CommandList
                                      children: [
                                        (C {(dirname)} {($ Id.VSub_DollarName '$bashdb_main')})
                                      ]
                                    )
                                )
                              }
                            )
                          ]
                        )
                    )
                  }
                )
              ]
            )
        )
      }
    )
    (command.ControlFlow token:(Token id:Id.ControlFlow_Exit val:exit span_id:142) arg_word:{(0)})
  ]
)