(command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {($ Id.VSub_Pound '$#')} right: {(2)} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:14) ) ] action: [ (command.Simple words: [{(echo)} {(DQ ('Usage ') ($ Id.VSub_Number '$0') (' BASH_PROGRAM PREFIX'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:21) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:31) arg_word: {(3)} ) ] spids: [3 16] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:SH_PROG) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [37] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PREFIX) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [40] ) ] ) (C {(typeset)} {(-i)} {(Id.Lit_VarLike 'rc=') (0)}) (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:51) command_list: (command.CommandList children: [ (C {($ Id.VSub_DollarName '$SH_PROG')} {(-c)} {(SQ (Token id:Id.Lit_Chars val:'echo ${SHELL}' span_id:57))} ) ] ) ) } spids: [50] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:rc) op: assign_op.Equal rhs: {($ Id.VSub_QMark '$?')} spids: [61] ) ] ) (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:68)) right: (arith_expr.ArithWord w:{(Id.Lit_Digits 0)}) ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:77) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ('Something went wrong in getting ') (word_part.EscapedLiteral token: (Token id:Id.Lit_EscapedChar val:'\\$' span_id:89) ) ('SHELL for ') ($ Id.VSub_DollarName '$SH_PROG') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:84) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:95) arg_word: {($ Id.VSub_DollarName '$rc')} ) ] spids: [64 79] ) ] ) (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:111) ) ] 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:123) ) ('SHELL for ') ($ Id.VSub_DollarName '$SH_PROG') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:118) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:129) arg_word: {(3)} ) ] spids: [101 113] ) ] ) (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:136) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(strings)} {($ Id.VSub_DollarName '$SH_PROG')}) (C {(grep)} {(bashdb)}) ] negated: F ) ] ) ) } spids: [135] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:check_loc) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:149) command_list: (command.CommandList children: [ (C {(dirname)} { (command_sub left_token: (Token id:Id.Left_DollarParen val:'$(' span_id:152) command_list: (command.CommandList children: [(C {(dirname)} {($ Id.VSub_DollarName '$bashdb_main')})] ) ) } ) ] ) ) } spids: [148] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {($ Id.VSub_DollarName '$PREFIX')} right: {($ Id.VSub_DollarName '$check_loc')} ) ) terminator: (Token id:Id.Op_Semi val:';' span_id:171) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ('bash says prefix should be ') ($ Id.VSub_DollarName '$check_loc') ('. You gave ') ($ Id.VSub_DollarName '$PREFIX') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:178) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:189) arg_word: {(4)} ) ] spids: [159 173] ) ] ) (command.ControlFlow token:(Token id:Id.ControlFlow_Exit val:exit span_id:195) arg_word:{(0)}) ] )