(CommandList
  children: [
    (Assignment
      keyword: Assign_Typeset
      flags: [-i]
      pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{(0)} spids:[7])]
      spids: [3]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:SH_PROG)
          op: Equal
          rhs: 
            {
              (BracedVarSub
                token: <VSub_Name SH_PROG>
                suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{($ VSub_Name '$SHELL')})
                spids: [11 15]
              )
            }
          spids: [10]
        )
      ]
      spids: [10]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:SH_PROG)
          op: Equal
          rhs: 
            {
              (BracedVarSub
                token: <VSub_Name SH_PROG>
                suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(bash)})
                spids: [18 22]
              )
            }
          spids: [17]
        )
      ]
      spids: [17]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:bash_loc)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [(C {($ VSub_Name '$SH_PROG')} {(-c)} {(SQ <'echo ${SHELL}'>)})]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [25 33]
              )
            }
          spids: [24]
        )
      ]
      spids: [24]
    )
    (Assignment
      keyword: Assign_None
      pairs: [(assign_pair lhs:(LhsName name:rc) op:Equal rhs:{($ VSub_QMark '$?')} spids:[35])]
      spids: [35]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: 
                (DParen
                  child: 
                    (ArithBinary
                      op_id: Arith_NEqual
                      left: (ArithVarRef name:rc)
                      right: (ArithWord w:{(Lit_Digits 0)})
                    )
                )
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ ('Something went wrong in getting ') 
                    (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('SHELL for ') ($ VSub_Name '$SH_PROG')
                  )
                }
              ]
              redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[58])]
            )
            (C {(exit)} {($ VSub_Name '$rc')})
          ]
          spids: [16777215 53]
        )
      ]
      spids: [16777215 73]
    )
    (If
      arms: [
        (if_arm
          cond: [
            (Sentence
              child: (DBracket expr:(BoolUnary op_id:BoolUnary_z child:{($ VSub_Name '$bash_loc')}))
              terminator: <Op_Semi ';'>
            )
          ]
          action: [
            (SimpleCommand
              words: [
                {(echo)}
                {
                  (DQ ('Something went wrong in setting bash location from ') 
                    (EscapedLiteralPart token:<Lit_EscapedChar '\\$'>) ('SHELL for ') ($ VSub_Name '$SH_PROG')
                  )
                }
              ]
              redirects: [(Redir op_id:Redir_GreatAnd fd:16777215 arg_word:{(2)} spids:[92])]
            )
            (C {(exit)} {(3)})
          ]
          spids: [16777215 87]
        )
      ]
      spids: [16777215 107]
    )
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:bashdb_main)
          op: Equal
          rhs: 
            {
              (CommandSubPart
                command_list: 
                  (CommandList
                    children: [
                      (Pipeline
                        children: [(C {(strings)} {($ VSub_Name '$bash_loc')}) (C {(grep)} {(bashdb)})]
                        negated: False
                      )
                    ]
                  )
                left_token: <Left_CommandSub '$('>
                spids: [113 123]
              )
            }
          spids: [112]
        )
      ]
      spids: [112]
    )
    (C {(echo)} 
      {
        (CommandSubPart
          command_list: 
            (CommandList
              children: [
                (C {(dirname)} 
                  {
                    (CommandSubPart
                      command_list: 
                        (CommandList
                          children: [
                            (C {(dirname)} 
                              {
                                (CommandSubPart
                                  command_list: 
                                    (CommandList
                                      children: [(C {(dirname)} {($ VSub_Name '$bashdb_main')})]
                                    )
                                  left_token: <Left_CommandSub '$('>
                                  spids: [134 138]
                                )
                              }
                            )
                          ]
                        )
                      left_token: <Left_CommandSub '$('>
                      spids: [131 139]
                    )
                  }
                )
              ]
            )
          left_token: <Left_CommandSub '$('>
          spids: [128 140]
        )
      }
    )
    (C {(exit)} {(0)})
  ]
)