(command.CommandList children: [ (command.ShFunction name_tok: <k_string_get_line> name: k_string_get_line body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<lineNo>} {<delim>}] redirects: [] do_fork: T ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '#')} {<-eq>} {<0>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <k_log_err> more_env: [] words: [{<k_log_err>} {(DQ <'k_string_get_line requires least 1 argument'>)}] redirects: [] do_fork: T ) (command.ControlFlow keyword: <Id.ControlFlow_Return return> arg_word: {<1>} ) ] spids: [58 71] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.ShAssignment left: <Id.Lit_VarLike 'delim='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'delim='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'delim='> name:delim) op: assign_op.Equal rhs: { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <printf> more_env: [] words: [{<printf>} {(SQ <'\\n '>)}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ) ] redirects: [] ) (command.ShAssignment left: <Id.Lit_VarLike 'lineNo='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'lineNo='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'lineNo='> name:lineNo) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number 1))} ) ] redirects: [] ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.Pipeline children: [ (command.Simple blame_tok: <echo> more_env: [] words: [{<echo>} {(DQ ($ Id.VSub_At '@'))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <cut> more_env: [] words: [ {<cut>} {<-d>} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name delim> var_name: delim suffix_op: (suffix_op.Unary op:<Id.VOp1_Percent '%'> arg_word:{<' '>}) right: <Id.Right_DollarBrace '}'> ) ) } {<-f>} {(DQ (${ Id.VSub_Name lineNo))} ] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <k_string_pad_right> name: k_string_pad_right body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<length>} {<text>}] redirects: [] do_fork: T ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '#')} {<-eq>} {<0>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <k_log_err> more_env: [] words: [{<k_log_err>} {(DQ <'k_string_pad_right requires least 1 argument'>)}] redirects: [] do_fork: T ) (command.ControlFlow keyword: <Id.ControlFlow_Return return> arg_word: {<1>} ) ] spids: [181 194] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.ShAssignment left: <Id.Lit_VarLike 'length='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'length='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'length='> name:length) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number 1))} ) ] redirects: [] ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <printf> more_env: [] words: [{<printf>} {(DQ <'%-'> (${ Id.VSub_Name length) <s>)} {(DQ ($ Id.VSub_Star '*'))}] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <k_string_pad_left> name: k_string_pad_left body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<length>} {<text>}] redirects: [] do_fork: T ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '#')} {<-eq>} {<0>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <k_log_err> more_env: [] words: [{<k_log_err>} {(DQ <'k_string_pad_left requires least 1 argument'>)}] redirects: [] do_fork: T ) (command.ControlFlow keyword: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [280 293] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.ShAssignment left: <Id.Lit_VarLike 'length='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'length='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'length='> name:length) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number 1))} ) ] redirects: [] ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <printf> more_env: [] words: [{<printf>} {(DQ <'%+'> (${ Id.VSub_Name length) <s>)} {(DQ ($ Id.VSub_Star '*'))}] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <k_string_lower> name: k_string_lower body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Pipeline children: [ (command.Simple blame_tok: <printf> more_env: [] words: [{<printf>} {(DQ <'%s'>)} {(DQ ($ Id.VSub_Star '*'))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <tr> more_env: [] words: [{<tr>} {(SQ <'[:upper:]'>)} {(SQ <'[:lower:]'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <k_string_upper> name: k_string_upper body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Pipeline children: [ (command.Simple blame_tok: <printf> more_env: [] words: [{<printf>} {(DQ <'%s'>)} {(DQ ($ Id.VSub_Star '*'))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <tr> more_env: [] words: [{<tr>} {(SQ <'[:lower:]'>)} {(SQ <'[:upper:]'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <k_string_contains> name: k_string_contains body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<substring>} {<string>}] redirects: [] do_fork: T ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '#')} {<-lt>} {<2>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <k_log_err> more_env: [] words: [{<k_log_err>} {(DQ <'k_string_contains requires least 2 arguments'>)}] redirects: [] do_fork: T ) (command.ControlFlow keyword: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [483 496] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.ShAssignment left: <Id.Lit_VarLike 'substring='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'substring='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'substring='> name:substring) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Number 1))} ) ] redirects: [] ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike 'string='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'string='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'string='> name:string) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Star '*'))} ) ] redirects: [] ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.AndOr children: [ (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name string> var_name: string prefix_op: <Id.VSub_Pound '#'> right: <Id.Right_DollarBrace '}'> ) ) } {<-gt>} {<0>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name string> var_name: string suffix_op: (suffix_op.Unary op: <Id.VOp1_Percent '%'> arg_word: {<Id.Lit_Other '*'> (${ Id.VSub_Name substring) <Id.Lit_Other '*'> } ) right: <Id.Right_DollarBrace '}'> ) ) } {<Id.KW_Bang '!'> <Id.Lit_Equals '='>} {(DQ (${ Id.VSub_Name string))} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) ] ops: [<Id.Op_DAmp _>] ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [(command.ControlFlow keyword:<Id.ControlFlow_Return return> arg_word:{<0>})] spids: [533 578] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.ControlFlow keyword:<Id.ControlFlow_Return return> arg_word:{<1>}) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <k_string_starts_with> name: k_string_starts_with body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<substring>} {<string>}] redirects: [] do_fork: T ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '#')} {<-lt>} {<2>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <k_log_err> more_env: [] words: [{<k_log_err>} {(DQ <'k_string_starts_with requires least 2 arguments'>)}] redirects: [] do_fork: T ) (command.ControlFlow keyword: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [635 648] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.ShAssignment left: <Id.Lit_VarLike 'substring='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'substring='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'substring='> name:substring) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Number 1))} ) ] redirects: [] ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike 'string='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'string='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'string='> name:string) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Star '*'))} ) ] redirects: [] ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.AndOr children: [ (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name string> var_name: string prefix_op: <Id.VSub_Pound '#'> right: <Id.Right_DollarBrace '}'> ) ) } {<-gt>} {<0>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name string> var_name: string suffix_op: (suffix_op.Unary op: <Id.VOp1_DPercent '%%'> arg_word: {(${ Id.VSub_Name substring) <Id.Lit_Other '*'>} ) right: <Id.Right_DollarBrace '}'> ) ) } {<Id.Lit_Equals '='>} {(DQ )} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) ] ops: [<Id.Op_DAmp _>] ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [(command.ControlFlow keyword:<Id.ControlFlow_Return return> arg_word:{<0>})] spids: [685 725] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.ControlFlow keyword:<Id.ControlFlow_Return return> arg_word:{<1>}) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <k_string_ends_with> name: k_string_ends_with body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<substring>} {<string>}] redirects: [] do_fork: T ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '#')} {<-lt>} {<2>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <k_log_err> more_env: [] words: [{<k_log_err>} {(DQ <'k_string_ends_with requires least 2 arguments'>)}] redirects: [] do_fork: T ) (command.ControlFlow keyword: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [782 795] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.ShAssignment left: <Id.Lit_VarLike 'substring='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'substring='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'substring='> name:substring) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Number 1))} ) ] redirects: [] ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike 'string='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'string='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'string='> name:string) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Star '*'))} ) ] redirects: [] ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.AndOr children: [ (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name string> var_name: string prefix_op: <Id.VSub_Pound '#'> right: <Id.Right_DollarBrace '}'> ) ) } {<-gt>} {<0>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name string> var_name: string suffix_op: (suffix_op.Unary op: <Id.VOp1_DPound '##'> arg_word: {<Id.Lit_Other '*'> (${ Id.VSub_Name substring)} ) right: <Id.Right_DollarBrace '}'> ) ) } {<Id.Lit_Equals '='>} {(DQ )} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) ] ops: [<Id.Op_DAmp _>] ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [(command.ControlFlow keyword:<Id.ControlFlow_Return return> arg_word:{<0>})] spids: [832 872] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.ControlFlow keyword:<Id.ControlFlow_Return return> arg_word:{<1>}) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <k_string_remove_start> name: k_string_remove_start body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<substring>} {<string>} {<Id.Lit_VarLike 'greedy='> <false>}] redirects: [] do_fork: T ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <k_bool_parse> more_env: [] words: [ {<k_bool_parse>} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name REMOVE_GREEDY> var_name: REMOVE_GREEDY suffix_op: (suffix_op.Unary op: <Id.VTest_ColonHyphen _> arg_word: (rhs_word__Empty) ) right: <Id.Right_DollarBrace '}'> ) ) } ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } {<Id.Lit_Equals '='>} {<true>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.ShAssignment left: <Id.Lit_VarLike 'greedy='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'greedy='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'greedy='> name:greedy) op: assign_op.Equal rhs: {<true>} ) ] redirects: [] ) ] spids: [933 957] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '#')} {<-lt>} {<2>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <k_log_err> more_env: [] words: [{<k_log_err>} {(DQ <'k_string_remove_start requires least 2 arguments'>)}] redirects: [] do_fork: T ) (command.ControlFlow keyword: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [968 981] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.ShAssignment left: <Id.Lit_VarLike 'substring='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'substring='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'substring='> name:substring) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Number 1))} ) ] redirects: [] ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike 'string='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'string='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'string='> name:string) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Star '*'))} ) ] redirects: [] ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} {(${ Id.VSub_Name greedy)} {<Id.Lit_Equals '='>} {<true>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <printf> more_env: [] words: [ {<printf>} {(DQ <'%s'>)} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name string> var_name: string suffix_op: (suffix_op.Unary op: <Id.VOp1_DPound '##'> arg_word: {(${ Id.VSub_Name substring)} ) right: <Id.Right_DollarBrace '}'> ) ) } ] redirects: [] do_fork: T ) ] spids: [1018 1033] ) ] else_kw: <Id.KW_Else else> else_action: [ (command.Simple blame_tok: <printf> more_env: [] words: [ {<printf>} {(DQ <'%s'>)} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name string> var_name: string suffix_op: (suffix_op.Unary op: <Id.VOp1_Pound '#'> arg_word: {(${ Id.VSub_Name substring)} ) right: <Id.Right_DollarBrace '}'> ) ) } ] redirects: [] do_fork: T ) ] fi_kw: <Id.KW_Fi fi> redirects: [] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <k_string_remove_end> name: k_string_remove_end body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<substring>} {<string>} {<Id.Lit_VarLike 'greedy='> <false>}] redirects: [] do_fork: T ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <k_bool_parse> more_env: [] words: [ {<k_bool_parse>} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name REMOVE_GREEDY> var_name: REMOVE_GREEDY suffix_op: (suffix_op.Unary op: <Id.VTest_ColonHyphen _> arg_word: (rhs_word__Empty) ) right: <Id.Right_DollarBrace '}'> ) ) } ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } {<Id.Lit_Equals '='>} {<true>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.ShAssignment left: <Id.Lit_VarLike 'greedy='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'greedy='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'greedy='> name:greedy) op: assign_op.Equal rhs: {<true>} ) ] redirects: [] ) ] spids: [1123 1147] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '#')} {<-lt>} {<2>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <k_log_err> more_env: [] words: [{<k_log_err>} {(DQ <'k_string_remove_start requires least 2 arguments'>)}] redirects: [] do_fork: T ) (command.ControlFlow keyword: <Id.ControlFlow_Exit exit> arg_word: {<1>} ) ] spids: [1158 1171] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.ShAssignment left: <Id.Lit_VarLike 'substring='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'substring='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'substring='> name:substring) op: assign_op.Equal rhs: {(DQ (${ Id.VSub_Number 1))} ) ] redirects: [] ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike 'string='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'string='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'string='> name:string) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Star '*'))} ) ] redirects: [] ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} {(${ Id.VSub_Name greedy)} {<Id.Lit_Equals '='>} {<true>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <printf> more_env: [] words: [ {<printf>} {(DQ <'%s'>)} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name string> var_name: string suffix_op: (suffix_op.Unary op: <Id.VOp1_DPercent '%%'> arg_word: {(${ Id.VSub_Name substring)} ) right: <Id.Right_DollarBrace '}'> ) ) } ] redirects: [] do_fork: T ) ] spids: [1208 1223] ) ] else_kw: <Id.KW_Else else> else_action: [ (command.Simple blame_tok: <printf> more_env: [] words: [ {<printf>} {(DQ <'%s'>)} { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name string> var_name: string suffix_op: (suffix_op.Unary op: <Id.VOp1_Percent '%'> arg_word: {(${ Id.VSub_Name substring)} ) right: <Id.Right_DollarBrace '}'> ) ) } ] redirects: [] do_fork: T ) ] fi_kw: <Id.KW_Fi fi> redirects: [] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <k_string_join> name: k_string_join body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [ {<local>} {<Id.Lit_VarLike 'separator='> (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Number 1> var_name: 1 suffix_op: (suffix_op.Unary op:<Id.VTest_Hyphen _> arg_word:(rhs_word__Empty)) right: <Id.Right_DollarBrace '}'> ) ) } ] redirects: [] do_fork: T ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <k_string_remove_end> more_env: [] words: [ {<k_string_remove_end>} {(DQ (${ Id.VSub_Name separator))} { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <printf> more_env: [] words: [ {<printf>} {(DQ <'%s'> (${ Id.VSub_Name separator))} {(DQ ($ Id.VSub_At '@'))} ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <k_string_trim> name: k_string_trim body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Pipeline children: [ (command.Simple blame_tok: <printf> more_env: [] words: [{<printf>} {(DQ <'%s'>)} {(DQ ($ Id.VSub_Star '*'))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <sed> more_env: [] words: [ {<sed>} {<-e>} {(DQ <'s/^[[:space:]]*//g; s/[[:space:]]*'> <Id.Lit_Dollar '$'> <'//g;'>)} ] redirects: [] do_fork: T ) ] ops: [<Id.Op_Pipe _>] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <k_string_keyword_error> name: k_string_keyword_error body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<Id.Lit_VarLike 'input='> (DQ (${ Id.VSub_Number 1))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} {($ Id.VSub_Pound '#')} {<-gt>} {<0>} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) body: (command.DoGroup left: <Id.KW_Do do> children: [ (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <Id.Lit_LBracket '['> more_env: [] words: [ {<Id.Lit_LBracket '['>} {(DQ (${ Id.VSub_Name input))} {<Id.Lit_Equals '='>} {(DQ (${ Id.VSub_Number 1))} {<Id.Lit_RBracket ']'>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <printf> more_env: [] words: [{<printf>} {(DQ ($ Id.VSub_Number 1))}] redirects: [] do_fork: T ) (command.ControlFlow keyword: <Id.ControlFlow_Return return> arg_word: {<0>} ) ] spids: [1473 1494] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) ] right: <Id.KW_Done done> ) redirects: [] ) (command.ControlFlow keyword:<Id.ControlFlow_Return return> arg_word:{<1>}) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.ShFunction name_tok: <k_string_keyword> name: k_string_keyword body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <local> more_env: [] words: [{<local>} {<value>}] redirects: [] do_fork: T ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.ShAssignment left: <Id.Lit_VarLike 'value='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'value='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'value='> name:value) op: assign_op.Equal rhs: { (DQ (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <k_string_keyword_error> more_env: [] words: [ {<k_string_keyword_error>} {(DQ ($ Id.VSub_At '@'))} ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) ) } ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <echo> more_env: [] words: [{<echo>} {(DQ (${ Id.VSub_Name value))}] redirects: [] do_fork: T ) ] spids: [1562 1576] ) ] else_kw: <Id.KW_Else else> else_action: [ (command.Simple blame_tok: <shift> more_env: [] words: [ {<shift>} { (word_part.ArithSub left: <Id.Left_DollarDParen '$(('> anode: (arith_expr.Binary op_id: Id.Arith_Minus left: {($ Id.VSub_Pound '#')} right: {<Id.Lit_Digits 1>} ) right: <Id.Right_DollarDParen _> ) } ] redirects: [] do_fork: T ) (command.Simple blame_tok: <echo> more_env: [] words: [{<echo>} {(DQ ($ Id.VSub_Number 1))}] redirects: [] do_fork: T ) ] fi_kw: <Id.KW_Fi fi> redirects: [] ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) ] )