(command.CommandList children: [ (command.ShFunction name: err_exit body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (C {<print>} {<-u2>} {<-n>} {(DQ <Id.Lit_BadBackslash '\\'> <t>)}) (C {<print>} {<-u2>} {<-r>} {(${ Id.VSub_Name Command) <Id.Lit_LBracket '['> ($ Id.VSub_Number 1) <Id.Lit_RBracket ']'> <Id.Lit_Colon ':'> } { (DQ (braced_var_sub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_At '@'> var_name: '@' suffix_op: (suffix_op.Slice begin:{<Id.Lit_Digits 2>}) right: <Id.Arith_RBrace _> ) ) } ) (C {<let>} {<Id.Lit_VarLike 'Errors+='> <1>}) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (C {<alias>} {<Id.Lit_VarLike 'err_exit='> (SQ <'err_exit $LINENO'>)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'Command='> name:Command) op: assign_op.Equal rhs: { (braced_var_sub 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 '}'> ) } spids: [114] ) ] redirects: [] ) (C {<integer>} {<Id.Lit_VarLike 'Errors='> <0>}) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'tmp='> name:tmp) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<mktemp>} {<-dt>}) right: <Id.Eof_RParen _> ) } spids: [128] ) ] redirects: [] ) (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Sentence child: (C {<err_exit>} {<mktemp>} {<-dt>} {<failed>}) terminator: <Id.Op_Semi _> ) (command.Sentence child: (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<1>}) terminator: <Id.Op_Semi _> ) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ] ) (C {<trap>} {(DQ <'cd /; rm -rf '> ($ Id.VSub_DollarName tmp))} {<EXIT>}) (C {<alias>} {<Id.Lit_VarLike 'foo='> (SQ <'print hello'>)}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<foo>}) right: <Id.Eof_RParen _> ) } right: {<hello>} ) redirects: [] ) ] ) action: [(C {<err_exit>} {(SQ <'foo, where foo is alias for "print hello" failed'>)})] spids: [172 186] ) ] else_action: [] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<foo>} {<world>}) right: <Id.Eof_RParen _> ) } right: {(SQ <'hello world'>)} ) redirects: [] ) ] ) action: [(C {<err_exit>} {(SQ <'foo world, where foo is alias for "print hello" failed'>)})] spids: [196 214] ) ] else_action: [] redirects: [] ) (C {<alias>} {<Id.Lit_VarLike 'foo='> (SQ <'print hello '>)}) (C {<alias>} {<Id.Lit_VarLike 'bar='> <world>}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<foo>} {<bar>}) right: <Id.Eof_RParen _> ) } right: {(SQ <'hello world'>)} ) redirects: [] ) ] ) action: [(C {<err_exit>} {(SQ <'foo bar, where foo is alias for "print hello " failed'>)})] spids: [236 254] ) ] else_action: [] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<foo>} {(word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\b'> ch:b) <ar> } ) right: <Id.Eof_RParen _> ) } right: {(SQ <'hello bar'>)} ) redirects: [] ) ] ) action: [(C {<err_exit>} {(SQ <'foo \\bar, where foo is alias for "print hello " failed'>)})] spids: [264 283] ) ] else_action: [] redirects: [] ) (C {<alias>} {<Id.Lit_VarLike 'bar='> (SQ <'foo world'>)}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<bar>}) right: <Id.Eof_RParen _> ) } right: {(SQ <'hello world'>)} ) redirects: [] ) ] ) action: [(C {<err_exit>} {(SQ <'bar, where bar is alias for "foo world" failed'>)})] spids: [300 316] ) ] else_action: [] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<alias>} {<bar>}) right: <Id.Eof_RParen _> ) } right: {(DQ <'bar=\'foo world\''>)} ) redirects: [] ) ] ) action: [(C {<err_exit>} {(SQ <'alias bar, where bar is alias for "foo world" failed'>)})] spids: [326 344] ) ] else_action: [] redirects: [] ) (command.AndOr ops: [Id.Op_DPipe] children: [(C {<unalias>} {<foo>}) (C {<err_exit>} {(DQ <'unalias foo failed'>)})] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.Simple words: [{<alias>} {<foo>}] redirects: [(redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})] more_env: [] do_fork: T ) (C {<err_exit>} {(DQ <'alias for non-existent alias foo returns true'>)}) ] ) (C {<unset>} {<bar>}) (C {<alias>} {<Id.Lit_VarLike 'bar='> (DQ <'print foo'> ($ Id.VSub_DollarName bar))}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'bar='> name:bar) op: assign_op.Equal rhs: {<bar>} spids: [394] ) ] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<bar>}) right: <Id.Eof_RParen _> ) } right: {<foo>} ) redirects: [] ) ] ) action: [(C {<err_exit>} {(SQ <'alias bar, where bar is alias for "print foo$bar" failed'>)})] spids: [397 411] ) ] else_action: [] redirects: [] ) (C {<unset>} {<bar>}) (C {<alias>} {<Id.Lit_VarLike 'bar='> (SQ <'print hello'>)}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: {($ Id.VSub_DollarName bar)} right: {(SQ )} ) redirects: [] ) ] ) action: [(C {<err_exit>} {(SQ <'alias bar cause variable bar to be set'>)})] spids: [432 445] ) ] else_action: [] redirects: [] ) (C {<alias>} {<Id.KW_Bang '!'> <Id.KW_Bang '!'> <Id.Lit_Equals '='> <print>}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Simple words: [{<Id.KW_Bang '!'> <Id.KW_Bang '!'>} {<hello>}] redirects: [ (redir op: <Id.Redir_Great '2>'> loc: (redir_loc.Fd fd:2) arg: {<'/dev/null'>} ) ] more_env: [] do_fork: T ) right: <Id.Eof_RParen _> ) } right: {<hello>} ) redirects: [] ) ] ) action: [(C {<err_exit>} {(SQ <'alias for !!=print not working'>)})] spids: [462 482] ) ] else_action: [] redirects: [] ) (C {<alias>} {<Id.Lit_VarLike 'foo='> <echo>}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<print>} { (DQ (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<foo>} {<bar>}) right: <Id.Eof_RParen _> ) ) } ) right: <Id.Eof_RParen _> ) } right: {<bar>} ) redirects: [] ) ] ) action: [(C {<err_exit>} {(SQ <'alias in command substitution not working'>)})] spids: [497 520] ) ] else_action: [] redirects: [] ) (command.Subshell child:(C {<unalias>} {<foo>}) redirects:[]) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobNEqual left: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Simple words: [{<foo>} {<bar>}] redirects: [ (redir op: <Id.Redir_Great '2>'> loc: (redir_loc.Fd fd:2) arg: {<'/dev/null'>} ) ] more_env: [] do_fork: T ) right: <Id.Eof_RParen _> ) } right: {<bar>} ) redirects: [] ) ] ) action: [(C {<err_exit>} {(SQ <'alias not working after unalias in subshell'>)})] spids: [537 557] ) ] else_action: [] redirects: [] ) (command.Simple words: [{<builtin>} {<-d>} {<rm>}] redirects: [(redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})] more_env: [] do_fork: T ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Simple words: [{<whence>} {<rm>}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {<'/dev/null'>} ) ] more_env: [] do_fork: T ) ] ) action: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.LogicalNot child: (bool_expr.WordTest w: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<alias>} {<-t>}) (C {<grep>} {<Id.Lit_VarLike 'rm='>}) ] negated: F stderr_indices: [] ) right: <Id.Eof_RParen _> ) } ) ) redirects: [] ) (C {<err_exit>} {(SQ <'tracked alias not set'>)}) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'PATH='> name:PATH) op: assign_op.Equal rhs: {($ Id.VSub_DollarName PATH)} spids: [617] ) ] redirects: [] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.DBracket expr: (bool_expr.WordTest w: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [(C {<alias>} {<-t>}) (C {<grep>} {<Id.Lit_VarLike 'rm='>})] negated: F stderr_indices: [] ) right: <Id.Eof_RParen _> ) } ) redirects: [] ) (C {<err_exit>} {(SQ <'tracked alias not cleared'>)}) ] ) ] spids: [577 587] ) ] else_action: [] redirects: [] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (command.Simple words: [{<hash>} {<-r>}] redirects: [ (redir op: <Id.Redir_Great '2>'> loc: (redir_loc.Fd fd:2) arg: {<'/dev/null'>} ) ] more_env: [] do_fork: T ) (command.DBracket expr: (bool_expr.LogicalNot child: (bool_expr.WordTest w: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<hash>}) right: <Id.Eof_RParen _> ) } ) ) redirects: [] ) ] ) ] ) action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'PATH='> name:PATH) op: assign_op.Equal rhs: {($ Id.VSub_DollarName tmp) <Id.Lit_Colon ':'> <'/bin'> <Id.Lit_Colon ':'> <'/usr/bin'> } spids: [671] ) ] redirects: [] ) (command.ForEach iter_names: [i] iterable: (for_iter.Words words:[{<foo>} {<-foo>} {<-->}]) body: (command.DoGroup children: [ (command.Simple words: [{<print>} {(SQ <':'>)}] redirects: [ (redir op: <Id.Redir_Great '>'> loc: (redir_loc.Fd fd:1) arg: {($ Id.VSub_DollarName tmp) <'/'> ($ Id.VSub_DollarName i)} ) ] more_env: [] do_fork: T ) (C {<chmod>} {<Id.Lit_Other '+'> <x>} {($ Id.VSub_DollarName tmp) <'/'> ($ Id.VSub_DollarName i)} ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Simple words: [{<hash>} {<-r>} {<-->} {($ Id.VSub_DollarName i)}] redirects: [ (redir op: <Id.Redir_Great '2>'> loc: (redir_loc.Fd fd:2) arg: {<'/dev/null'>} ) ] more_env: [] do_fork: T ) (C {<err_exit>} {(DQ <'hash -r -- '> ($ Id.VSub_DollarName i) <' failed'>)}) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.DBracket expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<hash>}) right: <Id.Eof_RParen _> ) } right: {($ Id.VSub_DollarName i) <Id.BoolBinary_GlobEqual '='> ($ Id.VSub_DollarName tmp) <'/'> ($ Id.VSub_DollarName i) } ) redirects: [] ) (C {<err_exit>} { (DQ <'hash -r -- '> ($ Id.VSub_DollarName i) <' failed, expected '> ($ Id.VSub_DollarName i) <'='> ($ Id.VSub_DollarName tmp) <'/'> ($ Id.VSub_DollarName i) <', got '> (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<hash>}) right: <Id.Eof_RParen _> ) ) } ) ] ) ] ) redirects: [] ) ] spids: [648 669] ) ] else_action: [(C {<err_exit>} {(SQ <'hash -r failed'>)})] redirects: [] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Subshell child: (C {<alias>} {<Id.Lit_Colon ':'> <Id.Lit_VarLike 'pr='> <print>}) redirects: [(redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})] ) (C {<err_exit>} {(SQ <'alias beginning with : fails'>)}) ] ) (command.AndOr ops: [Id.Op_DPipe] children: [ (command.Subshell child: (C {<alias>} {<p> <Id.Lit_Colon ':'> <Id.Lit_VarLike 'r='> <print>}) redirects: [(redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})] ) (C {<err_exit>} {(SQ <'alias with : in name fails'>)}) ] ) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {(word_part.ArithSub anode:($ Id.Lit_ArithVarLike Errors))} ) ] )