(command.CommandList children: [ (command.ShFunction name: columnize body: (command.BraceGroup children: [ (C {(typeset)} {(-i)} {(Lit_VarLike 'displaywidth=') (braced_var_sub token: <VSub_Number 1> suffix_op: (suffix_op.Unary op_id:VTest_ColonHyphen arg_word:{(80)}) ) } ) (command.AndOr ops: [Op_DAmp Op_DPipe] children: [ (command.DParen child: (arith_expr.Binary op_id: Arith_Less left: (arith_expr.ArithWord w:{($ VSub_Pound '$#')}) right: (arith_expr.ArithWord w:{(Lit_Digits 2)}) ) ) (C {(typeset)} {(Lit_VarLike 'colsep=') (SQ <' '>)}) (C {(typeset)} {(Lit_VarLike 'colsep=') (DQ ($ VSub_Number '$2'))}) ] ) (C {(typeset)} {(-i)} {(Lit_VarLike 'list_size=') (braced_var_sub token: <VSub_Name list> prefix_op: VSub_Pound bracket_op: (bracket_op.WholeArray op_id:Lit_At) ) } ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Arith_DEqual left: (arith_expr.VarRef token:<Lit_ArithVarLike list_size>) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:columnized) op: Equal rhs: {(sh_array_literal left:<Op_LParen '('> words:[{(SQ <'<empty>'>)}])} ) ] ) (command.ControlFlow token:<ControlFlow_Return return>) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Arith_DEqual left: (arith_expr.ArithWord w:{(Lit_Digits 1)}) right: (arith_expr.VarRef token:<Lit_ArithVarLike list_size>) ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:columnized) op: Equal rhs: { (sh_array_literal left: <Op_LParen '('> words: [ { (DQ (braced_var_sub token: <VSub_Name list> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) ) ) } ] ) } ) ] ) (command.ControlFlow token:<ControlFlow_Return return>) ] ) ] ) (C {(typeset)} {(-i)} {(Lit_VarLike 'nrows=') (0)}) (C {(typeset)} {(-i)} {(Lit_VarLike 'ncols=') (0)}) (C {(typeset)} {(-a)} {(Lit_VarLike 'colwidths=') (sh_array_literal left:<Op_LParen '('>)}) (C {(typeset)} {(-i)} {(Lit_VarLike 'i=') (0)}) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Arith_Less left: (arith_expr.VarRef token:<Lit_ArithVarLike i>) right: (arith_expr.VarRef token:<Lit_ArithVarLike list_size>) ) update: (arith_expr.UnaryAssign op_id:Node_PostDPlus child:(sh_lhs_expr.Name name:i)) body: (command.DoGroup children: [ (C {(typeset)} {(-a)} {(Lit_VarLike 'colwidths=') (sh_array_literal left:<Op_LParen '('>)} ) (command.DParen child: (arith_expr.UnaryAssign op_id: Node_PostDPlus child: (sh_lhs_expr.Name name:nrows) ) ) (command.DParen child: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.Name name:ncols) right: (arith_expr.Binary op_id: Arith_Slash left: (arith_expr.Binary op_id: Arith_Minus left: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.VarRef token:<Lit_ArithVarLike list_size>) right: (arith_expr.VarRef token:<Lit_ArithVarLike nrows>) ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) right: (arith_expr.VarRef token:<Lit_ArithVarLike nrows>) ) ) ) (C {(typeset)} {(-i)} {(Lit_VarLike 'totwidth=') (-) (braced_var_sub token: <VSub_Name colsep> prefix_op: VSub_Pound ) } ) (C {(typeset)} {(-i)} {(col)}) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.Name name:col) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Arith_LessEqual left: (arith_expr.VarRef token:<Lit_ArithVarLike col>) right: (arith_expr.Binary op_id: Arith_Minus left: (arith_expr.VarRef token:<Lit_ArithVarLike ncols>) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) update: (arith_expr.UnaryAssign op_id: Node_PostDPlus child: (sh_lhs_expr.Name name:col) ) body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:colwidth) op: Equal rhs: {(0)} ) ] ) (C {(typeset)} {(-i)} {(row)}) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.Name name:row) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Arith_LessEqual left: (arith_expr.VarRef token:<Lit_ArithVarLike row>) right: (arith_expr.Binary op_id: Arith_Minus left: (arith_expr.VarRef token:<Lit_ArithVarLike nrows>) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) update: (arith_expr.UnaryAssign op_id: Node_PostDPlus child: (sh_lhs_expr.Name name:row) ) body: (command.DoGroup children: [ (C {(typeset)} {(-i)} {(j)}) (command.DParen child: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.Name name:j) right: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.VarRef token:<Lit_ArithVarLike row>) right: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.VarRef token: <Lit_ArithVarLike nrows> ) right: (arith_expr.VarRef token: <Lit_ArithVarLike col> ) ) ) ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Arith_GreatEqual left: (arith_expr.VarRef token: <Lit_ArithVarLike j> ) right: (arith_expr.VarRef token: <Lit_ArithVarLike list_size> ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.ControlFlow token: <ControlFlow_Break break> ) ] ) ] ) (C {(typeset)} {(Lit_VarLike 'item=') (DQ (braced_var_sub token: <VSub_Name list> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.VarRef token:<Lit_ArithVarLike j>) ) ) ) } ) (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Arith_Less left: (arith_expr.VarRef token: <Lit_ArithVarLike colwidth> ) right: (arith_expr.ArithWord w: { (braced_var_sub token: <VSub_Name item> prefix_op: VSub_Pound ) } ) ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:colwidth) op: Equal rhs: { (braced_var_sub token: <VSub_Name item> prefix_op: VSub_Pound ) } ) ] ) ] ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:colwidths) op: PlusEqual rhs: { (sh_array_literal left: <Op_LParen '('> words: [{($ VSub_DollarName '$colwidth')}] ) } ) ] ) (command.DParen child: (arith_expr.BinaryAssign op_id: Arith_PlusEqual left: (sh_lhs_expr.Name name:totwidth) right: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.VarRef token:<Lit_ArithVarLike colwidth>) right: (arith_expr.ArithWord w: { (braced_var_sub token: <VSub_Name colsep> prefix_op: VSub_Pound ) } ) ) ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Arith_Great left: (arith_expr.VarRef token: <Lit_ArithVarLike totwidth> ) right: (arith_expr.VarRef token: <Lit_ArithVarLike displaywidth> ) ) ) terminator: <Op_Semi ';'> ) ] action: [(command.ControlFlow token:<ControlFlow_Break break>)] ) ] ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Arith_LessEqual left: (arith_expr.VarRef token:<Lit_ArithVarLike totwidth>) right: (arith_expr.VarRef token:<Lit_ArithVarLike displaywidth>) ) ) terminator: <Op_Semi ';'> ) ] action: [(command.ControlFlow token:<ControlFlow_Break break>)] ) ] ) ] ) ) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.Name name:row) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Arith_Less left: (arith_expr.VarRef token:<Lit_ArithVarLike row>) right: (arith_expr.VarRef token:<Lit_ArithVarLike nrows>) ) update: (arith_expr.UnaryAssign op_id:Node_PostDPlus child:(sh_lhs_expr.Name name:row)) body: (command.DoGroup children: [ (C {(typeset)} {(-i)} {(Lit_VarLike 'text_size=') (0)}) (C {(typeset)} {(-a)} {(Lit_VarLike 'texts=') (sh_array_literal left:<Op_LParen '('>)} ) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.Name name:col) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Arith_Less left: (arith_expr.VarRef token:<Lit_ArithVarLike col>) right: (arith_expr.VarRef token:<Lit_ArithVarLike ncols>) ) update: (arith_expr.UnaryAssign op_id: Node_PostDPlus child: (sh_lhs_expr.Name name:col) ) body: (command.DoGroup children: [ (command.DParen child: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.Binary op_id: Arith_Plus left: (arith_expr.VarRef token:<Lit_ArithVarLike row>) right: (arith_expr.Binary op_id: Arith_Star left: (arith_expr.VarRef token:<Lit_ArithVarLike nrows>) right: (arith_expr.VarRef token:<Lit_ArithVarLike col>) ) ) ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DParen child: (arith_expr.Binary op_id: Arith_GreatEqual left: (arith_expr.VarRef token:<Lit_ArithVarLike i>) right: (arith_expr.VarRef token: <Lit_ArithVarLike list_size> ) ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:item) op:Equal rhs:{(SQ )})] ) ] ) ] else_action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:item) op: Equal rhs: { (DQ (braced_var_sub token: <VSub_Name list> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.VarRef token:<Lit_ArithVarLike i>) ) ) ) } ) ] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.IndexedName name: texts index: (arith_expr.ArithWord w: {($ VSub_DollarName '$text_size')} ) ) op: Equal rhs: {(DQ ($ VSub_DollarName '$item'))} ) ] ) (command.DParen child: (arith_expr.UnaryAssign op_id: Node_PostDPlus child: (sh_lhs_expr.Name name:text_size) ) ) ] ) ) (command.WhileUntil keyword: <KW_While while> cond: [ (command.Sentence child: (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Arith_Great left: (arith_expr.VarRef token:<Lit_ArithVarLike text_size>) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) ) (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobDEqual left: { (braced_var_sub token: <VSub_Name texts> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.Binary op_id: Arith_Minus left: (arith_expr.VarRef token: <Lit_ArithVarLike text_size> ) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) ) } right: {(SQ )} ) ) ] ) terminator: <Op_Semi ';'> ) ] body: (command.DoGroup children: [ (command.DParen child: (arith_expr.UnaryAssign op_id: Node_PostDMinus child: (sh_lhs_expr.Name name:text_size) ) ) (C {(unset)} {(Lit_ArrayLhsOpen 'texts[') ($ VSub_DollarName '$text_size') (Lit_RBracket ']') } ) ] ) ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:text_row) op:Equal rhs:{(SQ )})] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:text_cell) op:Equal rhs:{(SQ )})] ) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.Name name:col) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Arith_Less left: (arith_expr.VarRef token:<Lit_ArithVarLike col>) right: (arith_expr.VarRef token:<Lit_ArithVarLike text_size>) ) update: (arith_expr.UnaryAssign op_id: Node_PostDPlus child: (sh_lhs_expr.Name name:col) ) body: (command.DoGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:fmt) op: Equal rhs: { (DQ ('%-') (braced_var_sub token: <VSub_Name colwidths> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.VarRef token:<Lit_ArithVarLike col>) ) ) (s) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:text_cell) op: Equal rhs: { (command_sub left_token: <Left_DollarParen '$('> command_list: (command.CommandList children: [ (C {(printf)} {($ VSub_DollarName '$fmt')} { (DQ (braced_var_sub token: <VSub_Name texts> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.VarRef token: <Lit_ArithVarLike col> ) ) ) ) } ) ] ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:text_row) op: PlusEqual rhs: {(DQ (${ VSub_Name text_cell))} ) ] ) (command.AndOr ops: [Op_DAmp] children: [ (command.DParen child: (arith_expr.Binary op_id: Arith_NEqual left: (arith_expr.VarRef token:<Lit_ArithVarLike col>) right: (arith_expr.Binary op_id: Arith_Minus left: (arith_expr.VarRef token:<Lit_ArithVarLike text_size>) right: (arith_expr.ArithWord w:{(Lit_Digits 1)}) ) ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:text_row) op: PlusEqual rhs: {(DQ (${ VSub_Name colsep))} ) ] ) ] ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:columnized) op: PlusEqual rhs: { (sh_array_literal left: <Op_LParen '('> words: [{(DQ ($ VSub_DollarName '$text_row'))}] ) } ) ] ) ] ) ) ] ) ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.DBracket expr: (bool_expr.Binary op_id: BoolBinary_GlobDEqual left: {($ VSub_Number '$0')} right: { (braced_var_sub token: <VSub_Name BASH_SOURCE> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) ) } ) ) terminator: <Op_Semi ';'> ) ] action: [ (command.ShFunction name: print_columns body: (command.BraceGroup children: [ (C {(unset)} {(columnized)}) (C {(typeset)} {(-a)} {(columnized)}) (C {(typeset)} {(-a)} {(list)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:list) op: Equal rhs: {(sh_array_literal left:<Op_LParen '('> words:[{($ VSub_Number '$1')}])} ) ] ) (C {(columnize)} {($ VSub_Number '$2')} {($ VSub_Number '$3')}) (C {(typeset)} {(-i)} {(i)}) (C {(echo)} {(SQ <'==============='>)}) (command.ForExpr init: (arith_expr.BinaryAssign op_id: Arith_Equal left: (sh_lhs_expr.Name name:i) right: (arith_expr.ArithWord w:{(Lit_Digits 0)}) ) cond: (arith_expr.Binary op_id: Arith_Less left: (arith_expr.VarRef token:<Lit_ArithVarLike i>) right: (arith_expr.ArithWord w: { (braced_var_sub token: <VSub_Name columnized> prefix_op: VSub_Pound bracket_op: (bracket_op.WholeArray op_id:Lit_At) ) } ) ) update: (arith_expr.UnaryAssign op_id: Node_PostDPlus child: (sh_lhs_expr.Name name:i) ) body: (command.DoGroup children: [ (C {(printf)} { (DQ (braced_var_sub token: <VSub_Name columnized> bracket_op: (bracket_op.ArrayIndex expr: (arith_expr.ArithWord w:{($ VSub_DollarName '$i')}) ) ) (Lit_Other '\\') (n) ) } ) ] ) ) ] ) ) (C {(print_columns)}) (C {(print_columns)} {(SQ )}) (C {(print_columns)} {(oneitem)}) (C {(print_columns)} {(SQ <'a 2 c'>)} {(10)} {(SQ <', '>)}) (C {(print_columns)} { (SQ <' one two three\n'> <' 4ne 5wo 6hree\n'> <' 7ne 8wo 9hree\n'> <' 10e 11o 12ree'>) } {(18)} ) (C {(print_columns)} {(SQ <' 1 two three\n'> <' for 5 six\n'> <' 7 8'>)} {(12)}) (C {(print_columns)} {(SQ <' 1 two 3\n'> <' for 5 six\n'> <' 7 8'>)} {(12)}) ] ) ] ) ] )