(command.CommandList children: [ (command.ShFunction keyword: <Id.KW_Function function> name_tok: <err_exit> name: err_exit body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <print> more_env: [] words: [{<print>} {<-u2>} {<-n>} {(DQ <Id.Lit_BadBackslash '\\'> <t>)}] redirects: [] do_fork: T ) (command.Simple blame_tok: <print> more_env: [] words: [ {<print>} {<-u2>} {<-r>} {(${ Id.VSub_Name Command) <Id.Lit_LBracket '['> ($ Id.VSub_Number 1) <Id.Lit_RBracket ']'> <Id.Lit_Colon ':'> } { (DQ (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_At '@'> var_name: '@' suffix_op: (suffix_op.Slice begin:{<Id.Lit_Digits 2>}) right: <Id.Arith_RBrace _> ) ) } ] redirects: [] do_fork: T ) (command.Simple blame_tok: <let> more_env: [] words: [{<let>} {<Id.Lit_VarLike 'Errors+='> <1>}] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.Simple blame_tok: <alias> more_env: [] words: [{<alias>} {<Id.Lit_VarLike 'err_exit='> (SQ <'err_exit $LINENO'>)}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike 'Command='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'Command='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'Command='> name:Command) op: assign_op.Equal rhs: { (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Number 0> var_name: 0 suffix_op: (suffix_op.Unary op: <Id.VOp1_DPound '##'> arg_word: {<Id.Lit_Other '*'> <Id.Lit_Slash '/'>} ) right: <Id.Right_DollarBrace '}'> ) } ) ] redirects: [] ) (command.Simple blame_tok: <integer> more_env: [] words: [{<integer>} {<Id.Lit_VarLike 'Errors='> <0>}] redirects: [] do_fork: T ) (command.AndOr children: [ (command.ShAssignment left: <Id.Lit_VarLike 'tmp='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'tmp='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tmp='> name:tmp) op: assign_op.Equal rhs: { (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <mktemp> more_env: [] words: [{<mktemp>} {<-dt>}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) } ) ] redirects: [] ) (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {<mktemp>} {<-dt>} {<failed>}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ControlFlow keyword:<Id.ControlFlow_Exit exit> arg_word:{<1>}) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ] ops: [<Id.Op_DPipe _>] ) (command.Simple blame_tok: <trap> more_env: [] words: [{<trap>} {(DQ <'cd /; rm -rf '> ($ Id.VSub_DollarName tmp))} {<EXIT>}] redirects: [] do_fork: T ) (command.ShFunction keyword: <Id.KW_Function function> name_tok: <grep> name: grep body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.ShAssignment left: <Id.Lit_VarLike 'vflag='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'vflag='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'vflag='> name:vflag) op: assign_op.Equal rhs: (rhs_word__Empty) ) (AssignPair left: <Id.Lit_VarLike 'xflag='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'xflag='> name:xflag) op: assign_op.Equal rhs: (rhs_word__Empty) ) (AssignPair left: <Id.Lit_VarLike 'cflag='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'cflag='> name:cflag) op: assign_op.Equal rhs: (rhs_word__Empty) ) (AssignPair left: <Id.Lit_VarLike 'lflag='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'lflag='> name:lflag) op: assign_op.Equal rhs: (rhs_word__Empty) ) (AssignPair left: <Id.Lit_VarLike 'nflag='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'nflag='> name:nflag) op: assign_op.Equal rhs: (rhs_word__Empty) ) ] redirects: [] ) (command.Simple blame_tok: <set> more_env: [] words: [{<set>} {<-f>}] redirects: [] do_fork: T ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.DParen left: <Id.Op_DLeftParen _> child: {<Id.Lit_Digits 1>} right: <Id.Op_DRightParen _> redirects: [] ) ] ) body: (command.DoGroup left: <Id.KW_Do do> children: [ (command.Case case_kw: <Id.KW_Case case> to_match: (case_arg.Word w:{(DQ ($ Id.VSub_Number 1))}) arms_start: <Id.KW_In in> arms: [ (CaseArm left: <-v> pattern: (pat.Words words:[{<-v> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.ShAssignment left: <Id.Lit_VarLike 'vflag='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'vflag='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'vflag='> name:vflag) op: assign_op.Equal rhs: {<1>} ) ] redirects: [] ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <-x> pattern: (pat.Words words:[{<-x> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.ShAssignment left: <Id.Lit_VarLike 'xflag='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'xflag='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'xflag='> name:xflag) op: assign_op.Equal rhs: {<1>} ) ] redirects: [] ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <-c> pattern: (pat.Words words:[{<-c> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.ShAssignment left: <Id.Lit_VarLike 'cflag='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'cflag='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'cflag='> name:cflag) op: assign_op.Equal rhs: {<1>} ) ] redirects: [] ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <-l> pattern: (pat.Words words:[{<-l> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.ShAssignment left: <Id.Lit_VarLike 'lflag='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'lflag='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'lflag='> name:lflag) op: assign_op.Equal rhs: {<1>} ) ] redirects: [] ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <-n> pattern: (pat.Words words:[{<-n> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.ShAssignment left: <Id.Lit_VarLike 'nflag='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'nflag='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'nflag='> name:nflag) op: assign_op.Equal rhs: {<1>} ) ] redirects: [] ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <-b> pattern: (pat.Words words:[{<-b> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.Simple blame_tok: <print> more_env: [] words: [{<print>} {(SQ <'b option not supported'>)}] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <-e> pattern: (pat.Words words:[{<-e> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.Sentence child: (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) (command.ShAssignment left: <Id.Lit_VarLike 'expr='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'expr='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'expr='> name:expr) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number 1))} ) ] redirects: [] ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <-f> pattern: (pat.Words words:[{<-f> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.Sentence child: (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) (command.ShAssignment left: <Id.Lit_VarLike 'expr='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'expr='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'expr='> name:expr) op: assign_op.Equal rhs: { (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <Id.Redir_Less '<'> more_env: [] words: [] redirects: [ (Redir op: <Id.Redir_Less '<'> loc: (redir_loc.Fd fd:0) arg: {($ Id.VSub_Number 1)} ) ] do_fork: F ) right: <Id.Eof_RParen _> ) } ) ] redirects: [] ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <-> pattern: (pat.Words words:[{<-> <Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.Sentence child: (command.Simple blame_tok: <print> more_env: [] words: [ {<print>} {($ Id.VSub_Number 0) <Id.Lit_Colon ':'>} {(SQ <'unknown flag'>)} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) (command.ControlFlow keyword: <Id.ControlFlow_Return return> arg_word: {<2>} ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <Id.Lit_Star '*'> pattern: (pat.Words words:[{<Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Simple blame_tok: <test> more_env: [] words: [ {<test>} {(DQ ($ Id.VSub_DollarName expr))} {<Id.Lit_Equals '='>} {(SQ )} ] redirects: [] do_fork: T ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Sentence child: (command.ShAssignment left: <Id.Lit_VarLike 'expr='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'expr='> lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike 'expr='> name: expr ) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Number 1))} ) ] redirects: [] ) terminator: <Id.Op_Semi _> ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) ] spids: [330 344] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.AndOr children: [ (command.Simple blame_tok: <test> more_env: [] words: [{<test>} {(DQ ($ Id.VSub_DollarName xflag))}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike 'expr='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'expr='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'expr='> name:expr) op: assign_op.Equal rhs: {(DQ <'*'> (${ Id.VSub_Name expr) <'*'>)} ) ] redirects: [] ) ] ops: [<Id.Op_DPipe _>] ) (command.ControlFlow keyword: <Id.ControlFlow_Break break> ) ] right: <Id.Op_DSemi _> ) ] arms_end: <Id.KW_Esac esac> redirects: [] ) (command.Simple blame_tok: <shift> more_env: [] words: [{<shift>}] redirects: [] do_fork: T ) ] right: <Id.KW_Done done> ) redirects: [] ) (command.ShAssignment left: <Id.Lit_VarLike 'noprint='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'noprint='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'noprint='> name:noprint) op: assign_op.Equal rhs: {($ Id.VSub_DollarName vflag) ($ Id.VSub_DollarName cflag) ($ Id.VSub_DollarName lflag) } ) ] redirects: [] ) (command.Simple blame_tok: <integer> more_env: [] words: [ {<integer>} {<Id.Lit_VarLike 'n='> <0>} {<Id.Lit_VarLike 'c='> <0>} {<Id.Lit_VarLike 'tc='> <0>} {<Id.Lit_VarLike 'nargs='> ($ Id.VSub_Pound '#')} ] redirects: [] do_fork: T ) (command.ForEach keyword: <Id.KW_For for> iter_names: [i] iterable: (for_iter.Words words:[{(DQ ($ Id.VSub_At '@'))}]) 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.DParen left: <Id.Op_DLeftParen _> child: (arith_expr.Binary op_id: Id.Arith_LessEqual left: ($ Id.Lit_ArithVarLike nargs) right: {<Id.Lit_Digits 1>} ) right: <Id.Op_DRightParen _> redirects: [] ) ] ) then_kw: <Id.KW_Then then> action: [ (command.ShAssignment left: <Id.Lit_VarLike 'fname='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'fname='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'fname='> name:fname) op: assign_op.Equal rhs: {(SQ )} ) ] redirects: [] ) ] spids: [434 444] ) ] else_kw: <Id.KW_Else else> else_action: [ (command.ShAssignment left: <Id.Lit_VarLike 'fname='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'fname='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'fname='> name:fname) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName i)) <Id.Lit_Colon ':'>} ) ] redirects: [] ) ] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.AndOr children: [ (command.Simple blame_tok: <test> more_env: [] words: [{<test>} {(DQ ($ Id.VSub_DollarName i))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <exec> more_env: [] words: [{<exec>}] redirects: [ (Redir op: <Id.Redir_Less '0<'> loc: (redir_loc.Fd fd:0) arg: {($ Id.VSub_DollarName i)} ) ] do_fork: T ) ] ops: [<Id.Op_DAmp _>] ) (command.WhileUntil keyword: <Id.KW_While while> cond: (condition.Shell commands: [ (command.Simple blame_tok: <read> more_env: [] words: [{<read>} {<-r>} {<line>}] redirects: [] do_fork: T ) ] ) body: (command.DoGroup left: <Id.KW_Do do> children: [ (command.Simple blame_tok: <let> more_env: [] words: [{<let>} {<Id.Lit_VarLike 'n='> <n> <Id.Lit_Other '+'> <1>}] redirects: [] do_fork: T ) (command.Case case_kw: <Id.KW_Case case> to_match: (case_arg.Word w:{(DQ ($ Id.VSub_DollarName line))}) arms_start: <Id.KW_In in> arms: [ (CaseArm left: <Id.VSub_DollarName '$expr'> pattern: (pat.Words words:[{($ Id.VSub_DollarName expr)}]) middle: <Id.Right_CasePat _> action: [ (command.AndOr children: [ (command.Simple blame_tok: <test> more_env: [] words: [{<test>} {(DQ ($ Id.VSub_DollarName noprint))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <print> more_env: [] words: [ {<print>} {<-r>} {<-->} { (DQ ($ Id.VSub_DollarName fname) (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name nflag> var_name: nflag suffix_op: (suffix_op.Unary op: <Id.VTest_ColonPlus _> arg_word: {($ Id.VSub_DollarName n) <':'>} ) right: <Id.Right_DollarBrace '}'> ) ($ Id.VSub_DollarName line) ) } ] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.Simple blame_tok: <let> more_env: [] words: [ {<let>} {<Id.Lit_VarLike 'c='> <c> <Id.Lit_Other '+'> <1>} ] redirects: [] do_fork: T ) ] right: <Id.Op_DSemi _> ) (CaseArm left: <Id.Lit_Star '*'> pattern: (pat.Words words:[{<Id.Lit_Star '*'>}]) middle: <Id.Right_CasePat _> action: [ (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Simple blame_tok: <test> more_env: [] words: [{<test>} {(DQ ($ Id.VSub_DollarName vflag))}] redirects: [] do_fork: T ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <print> more_env: [] words: [ {<print>} {<-r>} {<-->} { (DQ ($ Id.VSub_DollarName fname) (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name nflag> var_name: nflag suffix_op: (suffix_op.Unary op: <Id.VTest_ColonPlus _> arg_word: {($ Id.VSub_DollarName n) <':'>} ) right: <Id.Right_DollarBrace '}'> ) ($ Id.VSub_DollarName line) ) } ] redirects: [] do_fork: T ) ] spids: [562 571] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) ] right: <Id.Op_DSemi _> ) ] arms_end: <Id.KW_Esac esac> redirects: [] ) ] right: <Id.KW_Done done> ) redirects: [] ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.AndOr children: [ (command.Simple blame_tok: <test> more_env: [] words: [{<test>} {(DQ ($ Id.VSub_DollarName lflag))}] redirects: [] do_fork: T ) (command.DParen left: <Id.Op_DLeftParen _> child: ($ Id.Lit_ArithVarLike c) right: <Id.Op_DRightParen _> redirects: [] ) ] ops: [<Id.Op_DAmp _>] ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <print> more_env: [] words: [{<print>} {<-r>} {<-->} {(DQ ($ Id.VSub_DollarName i))}] redirects: [] do_fork: T ) ] spids: [601 617] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.Simple blame_tok: <let> more_env: [] words: [ {<let>} {<Id.Lit_VarLike 'tc='> <tc> <Id.Lit_Other '+'> <c>} {<Id.Lit_VarLike 'n='> <0>} {<Id.Lit_VarLike 'c='> <0>} ] redirects: [] do_fork: T ) ] right: <Id.KW_Done done> ) redirects: [] ) (command.AndOr children: [ (command.Simple blame_tok: <test> more_env: [] words: [{<test>} {(DQ ($ Id.VSub_DollarName cflag))}] redirects: [] do_fork: T ) (command.Simple blame_tok: <print> more_env: [] words: [{<print>} {($ Id.VSub_DollarName tc)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DAmp _>] ) (command.Simple blame_tok: <let> more_env: [] words: [{<let>} {<tc>}] redirects: [] do_fork: T ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.Simple blame_tok: <cat> more_env: [] words: [{<cat>}] redirects: [ (Redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {($ Id.VSub_DollarName tmp) <'/grep'>} ) (Redir op: <Id.Redir_DLess '<<'> loc: (redir_loc.Fd fd:0) arg: (redir_param.HereDoc here_begin: {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\!'> ch:'!')} here_end_tok: <Id.Undefined_Tok ''> stdin_parts: [ <'this is a food bar test\n'> <'to see how many lines find both foo and bar.\n'> <'Some line contain foo only,\n'> <'and some lines contain bar only.\n'> <'However, many lines contain both foo and also bar.\n'> <'A line containing foobar should also be counted.\n'> <'There should be six lines with foo and bar.\n'> <'There are only two line with out foo but with bar.\n'> ] ) ) ] do_fork: T ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.DParen left: <Id.Op_DLeftParen _> child: (arith_expr.Binary op_id: Id.Arith_NEqual left: { (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <grep> more_env: [] words: [ {<grep>} {<-c>} {(SQ <'foo*bar'>)} {($ Id.VSub_DollarName tmp) <'/grep'>} ] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) } right: {<Id.Lit_Digits 6>} ) right: <Id.Op_DRightParen _> redirects: [] ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>}] redirects: [] do_fork: T ) ] spids: [696 720] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.ControlFlow keyword: <Id.ControlFlow_Exit exit> arg_word: { (word_part.ArithSub left: <Id.Left_DollarDParen '$(('> anode: (arith_expr.TernaryOp cond: (arith_expr.Binary op_id: Id.Arith_Less left: ($ Id.Lit_ArithVarLike Errors) right: {<Id.Lit_Digits 125>} ) true_expr: ($ Id.Lit_ArithVarLike Errors) false_expr: {<Id.Lit_Digits 125>} ) right: <Id.Right_DollarDParen _> ) } ) ] )