(command.CommandList children: [ (C {<set>} {<-e>}) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [{<command>} {<-v>} {<tput>}] redirects: [(redir op:<Id.Redir_Great '>'> loc:(redir_loc.Fd fd:1) arg:{<'/dev/null'>})] do_fork: T ) (C {<exec>} {<grep>} {<-v>} {(DQ <'^begin '>)}) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:header_pattern) op: assign_op.Equal rhs: {(SQ <'[0-9]+\\.\\.[0-9]+'>)} spids: [33] ) ] ) (command.Simple words: [{<read>} {<-r>} {<header>}] more_env: [(env_pair name:IFS val:(word.Empty) spids:[38])] do_fork: T ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: {(DQ ($ Id.VSub_DollarName '$header'))} right: {($ Id.VSub_DollarName '$header_pattern')} ) ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:count) op: assign_op.Equal rhs: { (DQ (braced_var_sub token: <Id.VSub_Name header> suffix_op: (suffix_op.Slice begin:{<Id.Lit_Digits 3>}) ) ) } spids: [65] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:index) op: assign_op.Equal rhs: {<0>} spids: [75] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:failures) op: assign_op.Equal rhs: {<0>} spids: [79] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:skipped) op: assign_op.Equal rhs: {<0>} spids: [83] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: {(DQ )} spids: [87] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:count_column_width) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: (arith_expr.Binary op_id: Id.Arith_Star left: { (braced_var_sub token: <Id.VSub_Name count> prefix_op: (Id.VSub_Pound) ) } right: {<Id.Lit_Digits 2>} ) right: {<Id.Lit_Digits 2>} ) ) } spids: [92] ) ] ) ] spids: [47 62] ) ] else_action: [ (C {<printf>} {(DQ <'%s'> <Id.Lit_BadBackslash '\\'> <n>)} {(DQ ($ Id.VSub_DollarName '$header'))} ) (C {<exec>} {<cat>}) ] ) (command.ShFunction name: update_screen_width body: (BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:screen_width) op: assign_op.Equal rhs: { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<tput>} {<cols>}) ) ) } spids: [145] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:count_column_left) op: assign_op.Equal rhs: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_DollarName '$screen_width')} right: {($ Id.VSub_DollarName '$count_column_width')} ) ) } spids: [155] ) ] ) ] ) ) (C {<trap>} {<update_screen_width>} {<WINCH>}) (C {<update_screen_width>}) (command.ShFunction name: begin body: (BraceGroup children: [ (C {<go_to_column>} {<0>}) (C {<printf_with_truncation>} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_DollarName '$count_column_left')} right: {<Id.Lit_Digits 1>} ) ) } {(DQ <' %s'>)} {(DQ ($ Id.VSub_DollarName '$name'))} ) (C {<clear_to_end_of_line>}) (C {<go_to_column>} {($ Id.VSub_DollarName '$count_column_left')}) (C {<printf>} { (DQ <'%'> (braced_var_sub token:<Id.VSub_Name count> prefix_op:(Id.VSub_Pound)) <'s/'> (${ Id.VSub_Name count) ) } {(DQ ($ Id.VSub_DollarName '$index'))} ) (C {<go_to_column>} {<1>}) ] ) ) (command.ShFunction name: pass body: (BraceGroup children: [ (C {<go_to_column>} {<0>}) (C {<printf>} {(DQ <' ✓ %s'>)} {(DQ ($ Id.VSub_DollarName '$name'))}) (C {<advance>}) ] ) ) (command.ShFunction name: skip body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'reason='> (DQ ($ Id.VSub_Number '$1'))}) (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<Id.Lit_LBracket '['>} {<-z>} {(DQ ($ Id.VSub_DollarName '$reason'))} {<Id.Lit_RBracket ']'>} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:reason) op: assign_op.Equal rhs: {(DQ <': '> ($ Id.VSub_DollarName '$reason'))} spids: [302] ) ] ) ] ) (C {<go_to_column>} {<0>}) (C {<printf>} {(DQ <' - %s (skipped%s)'>)} {(DQ ($ Id.VSub_DollarName '$name'))} {(DQ ($ Id.VSub_DollarName '$reason'))} ) (C {<advance>}) ] ) ) (command.ShFunction name: fail body: (BraceGroup children: [ (C {<go_to_column>} {<0>}) (C {<set_color>} {<1>} {<bold>}) (C {<printf>} {(DQ <' ✗ %s'>)} {(DQ ($ Id.VSub_DollarName '$name'))}) (C {<advance>}) ] ) ) (command.ShFunction name: log body: (BraceGroup children: [ (C {<set_color>} {<1>}) (C {<printf>} {(DQ <' %s'> <Id.Lit_BadBackslash '\\'> <n>)} {(DQ ($ Id.VSub_Number '$1'))}) (C {<clear_color>}) ] ) ) (command.ShFunction name: summary body: (BraceGroup children: [ (C {<printf>} {(DQ <Id.Lit_BadBackslash '\\'> <'n%d test%s'>)} {(DQ ($ Id.VSub_DollarName '$count'))} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<plural>} {(DQ ($ Id.VSub_DollarName '$count'))}) ) ) } ) (C {<printf>} {(DQ <', %d failure%s'>)} {(DQ ($ Id.VSub_DollarName '$failures'))} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<plural>} {(DQ ($ Id.VSub_DollarName '$failures'))}) ) ) } ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$skipped'))} {<-gt>} {<0>} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<printf>} {(DQ <', %d skipped'>)} {(DQ ($ Id.VSub_DollarName '$skipped'))}) ] spids: [451 466] ) ] ) (C {<printf>} {(DQ <Id.Lit_BadBackslash '\\'> <n>)}) ] ) ) (command.ShFunction name: printf_with_truncation body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'width='> (DQ ($ Id.VSub_Number '$1'))}) (C {<shift>}) (C {<local>} {<Id.Lit_VarLike 'string='> (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<printf>} {(DQ ($ Id.VSub_At '$@'))}) ) ) } ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} { (DQ (braced_var_sub token: <Id.VSub_Name string> prefix_op: (Id.VSub_Pound) ) ) } {<-gt>} {(DQ ($ Id.VSub_DollarName '$width'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<printf>} {(DQ <'%s...'>)} { (DQ (braced_var_sub token: <Id.VSub_Name string> suffix_op: (suffix_op.Slice begin: {<Id.Lit_Digits 0>} length: { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_DollarName '$width')} right: {<Id.Lit_Digits 4>} ) ) } ) ) ) } ) ] spids: [527 547] ) ] else_action: [(C {<printf>} {(DQ <'%s'>)} {(DQ ($ Id.VSub_DollarName '$string'))})] ) ] ) ) (command.ShFunction name: go_to_column body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'column='> (DQ ($ Id.VSub_Number '$1'))}) (C {<printf>} {(DQ <Id.Lit_BadBackslash '\\'> <'x1B[%dG'>)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: {($ Id.VSub_DollarName '$column')} right: {<Id.Lit_Digits 1>} ) ) } ) ] ) ) (command.ShFunction name: clear_to_end_of_line body: (BraceGroup children:[(C {<printf>} {(DQ <Id.Lit_BadBackslash '\\'> <'x1B[K'>)})]) ) (command.ShFunction name: advance body: (BraceGroup children:[(C {<clear_to_end_of_line>}) (C {<echo>}) (C {<clear_color>})]) ) (command.ShFunction name: set_color body: (BraceGroup children: [ (C {<local>} {<Id.Lit_VarLike 'color='> (DQ ($ Id.VSub_Number '$1'))}) (C {<local>} {<Id.Lit_VarLike 'weight='> (DQ ($ Id.VSub_Number '$2'))}) (C {<printf>} {(DQ <Id.Lit_BadBackslash '\\'> <'x1B[%d;%dm'>)} { (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Plus left: {<Id.Lit_Digits 30>} right: {($ Id.VSub_DollarName '$color')} ) ) } { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.AndOr ops: [Id.Op_DAmp Id.Op_DPipe] children: [ (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$weight'))} {<Id.Lit_Equals '='>} {(DQ <bold>)} {<Id.Lit_RBracket ']'>} ) (C {<echo>} {<1>}) (C {<echo>} {<22>}) ] ) ) ) } ) ] ) ) (command.ShFunction name: clear_color body: (BraceGroup children:[(C {<printf>} {(DQ <Id.Lit_BadBackslash '\\'> <'x1B[0m'>)})]) ) (command.ShFunction name: plural body: (BraceGroup children: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_Number '$1'))} {<-eq>} {<1>} {<Id.Lit_RBracket ']'>} ) (C {<echo>} {(DQ <s>)}) ] ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:_buffer) op: assign_op.Equal rhs: {(DQ )} spids: [789] ) ] ) (command.ShFunction name: buffer body: (BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:_buffer) op: assign_op.Equal rhs: { (DQ (${ Id.VSub_Name _buffer) (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {(DQ ($ Id.VSub_At '$@'))}) ) ) } spids: [801] ) ] ) ] ) ) (command.ShFunction name: flush body: (BraceGroup children: [ (C {<printf>} {(DQ <'%s'>)} {(DQ ($ Id.VSub_DollarName '$_buffer'))}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:_buffer) op: assign_op.Equal rhs: {(DQ )} spids: [834] ) ] ) ] ) ) (command.ShFunction name: finish body: (BraceGroup children: [(C {<flush>}) (C {<printf>} {(DQ <Id.Lit_BadBackslash '\\'> <n>)})] ) ) (C {<trap>} {<finish>} {<EXIT>}) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple words: [{<read>} {<-r>} {<line>}] more_env: [(env_pair name:IFS val:(word.Empty) spids:[870])] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) body: (command.DoGroup children: [ (command.Case to_match: {(DQ ($ Id.VSub_DollarName '$line'))} arms: [ (case_arm pat_list: [{(DQ <'begin '>) <Id.Lit_Star '*'>}] action: [ (C {<let>} {<Id.Lit_VarLike 'index+='> <1>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:name) op: assign_op.Equal rhs: { (DQ (braced_var_sub token: <Id.VSub_Name line> suffix_op: (suffix_op.Unary tok: <Id.VOp1_Pound '#'> arg_word: {<Id.Lit_Other '*'> <' '> ($ Id.VSub_DollarName '$index') <' '>} ) ) ) } spids: [905] ) ] ) (C {<buffer>} {<begin>}) (C {<flush>}) ] spids: [891 896 926 -1] ) (case_arm pat_list: [{(DQ <'ok '>) <Id.Lit_Star '*'>}] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:skip_expr) op: assign_op.Equal rhs: { (DQ <'ok '> ($ Id.VSub_DollarName '$index') <' # skip ('> <Id.Lit_BadBackslash '\\'> <'(([^)]*)'> <Id.Lit_BadBackslash '\\'> <'))?'> ) } spids: [937] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_EqualTilde left: {(DQ ($ Id.VSub_DollarName '$line'))} right: {($ Id.VSub_DollarName '$skip_expr')} ) ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<let>} {<Id.Lit_VarLike 'skipped+='> <1>}) (C {<buffer>} {<skip>} { (DQ (braced_var_sub token: <Id.VSub_Name BASH_REMATCH> bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 2>}) ) ) } ) ] spids: [949 964] ) ] else_action: [(C {<buffer>} {<pass>})] ) ] spids: [929 934 998 -1] ) (case_arm pat_list: [{(DQ <'not ok '>) <Id.Lit_Star '*'>}] action: [(C {<let>} {<Id.Lit_VarLike 'failures+='> <1>}) (C {<buffer>} {<fail>})] spids: [1001 1006 1020 -1] ) (case_arm pat_list: [{(DQ <'# '>) <Id.Lit_Star '*'>}] action: [ (C {<buffer>} {<log>} { (DQ (braced_var_sub token: <Id.VSub_Name line> suffix_op: (suffix_op.Slice begin:{<Id.Lit_Digits 2>}) ) ) } ) ] spids: [1023 1028 1044 -1] ) ] ) ] ) ) (C {<buffer>} {<summary>}) ] )