(command.CommandList children: [ (C {(KW_Set set)} {(-e)}) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:count_only_flag) op:Equal rhs:{(DQ )})] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(DQ (-c))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:count_only_flag) op:Equal rhs:{(1)})] ) (C {(shift)}) ] ) ] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:extended_syntax_flag) op:Equal rhs:{(DQ )})] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_Number '$1'))} {(Lit_Equals '=')} {(DQ (-x))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:extended_syntax_flag) op: Equal rhs: {(DQ (-x))} ) ] ) (C {(shift)}) ] ) ] ) (C {(trap)} {(DQ ('kill 0; exit 1'))} {(int)}) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:count) op:Equal rhs:{(0)})] ) (command.ForEach iter_name: filename iter_words: [{(DQ ($ VSub_At '$@'))}] do_arg_iter: F body: (command.DoGroup children: [ (C {(let)} {(Lit_VarLike 'count+=') (DQ (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [(C {(bats-exec-test)} {(-c)} {(DQ ($ VSub_DollarName '$filename'))})] ) ) ) } ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(-n)} {(DQ ($ VSub_DollarName '$count_only_flag'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (C {(echo)} {(DQ ($ VSub_DollarName '$count'))}) (command.ControlFlow token:<ControlFlow_Exit exit>) ] ) ] ) (C {(echo)} {(DQ (1..) ($ VSub_DollarName '$count'))}) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:status) op:Equal rhs:{(0)})] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:offset) op:Equal rhs:{(0)})] ) (command.ForEach iter_name: filename iter_words: [{(DQ ($ VSub_At '$@'))}] do_arg_iter: F body: (command.DoGroup children: [ (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:index) op:Equal rhs:{(0)})] ) (command.BraceGroup children: [ (command.Simple words: [{(read)} {(-r)}] more_env: [(env_pair name:IFS val:(word.Empty))] ) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (command.Simple words: [{(read)} {(-r)} {(line)}] more_env: [(env_pair name:IFS val:(word.Empty))] ) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ VSub_DollarName '$line'))} arms: [ (case_arm pat_list: [{(DQ ('begin ')) (Lit_Star '*')}] action: [ (C {(let)} {(Lit_VarLike 'index+=') (1)}) (C {(echo)} { (DQ (braced_var_sub token: <VSub_Name line> suffix_op: (suffix_op.PatSub pat: {(' ') ($ VSub_DollarName '$index') (' ')} replace: {(' ') (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_DollarName '$offset')} ) right: (arith_expr.ArithWord w: {($ VSub_DollarName '$index')} ) ) ) (' ') } replace_mode: Undefined_Tok ) ) ) } ) ] ) (case_arm pat_list: [ {(DQ ('ok ')) (Lit_Star '*')} {(DQ ('not ok ')) (Lit_Star '*')} ] action: [ (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(-n)} {(DQ ($ VSub_DollarName '$extended_syntax_flag'))} {(Lit_RBracket ']')} ) (C {(let)} {(Lit_VarLike 'index+=') (1)}) ] ) (C {(echo)} { (DQ (braced_var_sub token: <VSub_Name line> suffix_op: (suffix_op.PatSub pat: {(' ') ($ VSub_DollarName '$index') (' ')} replace: {(' ') (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.ArithWord w: {($ VSub_DollarName '$offset')} ) right: (arith_expr.ArithWord w: {($ VSub_DollarName '$index')} ) ) ) (' ') } replace_mode: Undefined_Tok ) ) ) } ) (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} { (DQ (braced_var_sub token: <VSub_Name line> suffix_op: (suffix_op.Slice begin: (arith_expr.ArithWord w:{(Lit_Digits 0)}) length: (arith_expr.ArithWord w:{(Lit_Digits 6)}) ) ) ) } {(KW_Bang '!') (Lit_Equals '=')} {(DQ ('not ok'))} {(Lit_RBracket ']')} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:status) op: Equal rhs: {(1)} ) ] ) ] ) ] ) (case_arm pat_list: [{(Lit_Star '*')}] action: [(C {(echo)} {(DQ ($ VSub_DollarName '$line'))})] ) ] ) ] ) ) ] redirects: [ (redir.Redir op: <Redir_Less '<'> fd: 16777215 arg_word: { (command_sub left_token: <Left_ProcSubIn '<('> command_list: (command.CommandList children: [ (C {(bats-exec-test)} {($ VSub_DollarName '$extended_syntax_flag')} {(DQ ($ VSub_DollarName '$filename'))} ) ] ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:offset) op: Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.ArithWord w:{($ VSub_DollarName '$offset')}) right: (arith_expr.ArithWord w:{($ VSub_DollarName '$index')}) ) ) } ) ] ) ] ) ) (command.ControlFlow token: <ControlFlow_Exit exit> arg_word: {(DQ ($ VSub_DollarName '$status'))} ) ] )