(CommandList children: [ (FuncDef name: err_exit body: (BraceGroup children: [ (C {(print)} {(-u2)} {(-n)} {(DQ (EscapedLiteralPart token:<Lit_EscapedChar "\\t">))}) (C {(print)} {(-u2)} {(-r)} {(${ VSub_Name Command) (Lit_Other "[") ($ VSub_Number "$1") (Lit_Other "]") (Lit_Other ":") } { (DQ (BracedVarSub token: <VSub_At "@"> suffix_op: (Slice begin:(ArithWord w:{(Lit_Digits 2)})) spids: [90 94] ) ) } ) (C {(let)} {(Lit_VarLike "Errors+=") (1)}) ] spids: [61] ) spids: [57 60] ) (C {(alias)} {(Lit_VarLike "err_exit=") (SQ <"err_exit $LINENO">)}) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:Command) op: Equal rhs: { (BracedVarSub token: <VSub_Number 0> suffix_op: (StringUnary op_id:VOp1_DPound arg_word:{("*") (Lit_Slash /)}) spids: [114 119] ) } spids: [113] ) ] spids: [113] ) (C {(integer)} {(Lit_VarLike "Errors=") (0)}) (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tmp) op: Equal rhs: { (CommandSubPart command_list: (CommandList children:[(C {(mktemp)} {(-dt)})]) left_token: <Left_CommandSub "$("> spids: [128 132] ) } spids: [127] ) ] spids: [127] ) (BraceGroup children: [ (Sentence child: (C {(err_exit)} {(mktemp)} {(-dt)} {(failed)}) terminator: <Op_Semi ";"> ) (Sentence child:(C {(exit)} {(1)}) terminator:<Op_Semi ";">) ] spids: [136] ) ] op_id: Op_DPipe ) (C {(trap)} {(DQ ("cd /; rm -rf ") ($ VSub_Name "$tmp"))} {(EXIT)}) (C {(alias)} {(Lit_VarLike "foo=") (SQ <"print hello">)}) (If arms: [ (if_arm cond: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: { (CommandSubPart command_list: (CommandList children:[(C {(foo)})]) left_token: <Left_CommandSub "$("> spids: [175 177] ) } right: {(hello)} ) ) ] action: [(C {(err_exit)} {(SQ <"foo, where foo is alias for \"print hello\" failed">)})] spids: [-1 185] ) ] spids: [-1 193] ) (If arms: [ (if_arm cond: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: { (CommandSubPart command_list: (CommandList children:[(C {(foo)} {(world)})]) left_token: <Left_CommandSub "$("> spids: [199 203] ) } right: {(SQ <"hello world">)} ) ) ] action: [(C {(err_exit)} {(SQ <"foo world, where foo is alias for \"print hello\" failed">)})] spids: [-1 213] ) ] spids: [-1 221] ) (C {(alias)} {(Lit_VarLike "foo=") (SQ <"print hello ">)}) (C {(alias)} {(Lit_VarLike "bar=") (world)}) (If arms: [ (if_arm cond: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: { (CommandSubPart command_list: (CommandList children:[(C {(foo)} {(bar)})]) left_token: <Left_CommandSub "$("> spids: [239 243] ) } right: {(SQ <"hello world">)} ) ) ] action: [(C {(err_exit)} {(SQ <"foo bar, where foo is alias for \"print hello \" failed">)})] spids: [-1 253] ) ] spids: [-1 261] ) (If arms: [ (if_arm cond: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: { (CommandSubPart command_list: (CommandList children: [ (C {(foo)} {(EscapedLiteralPart token:<Lit_EscapedChar "\\b">) (ar)}) ] ) left_token: <Left_CommandSub "$("> spids: [267 272] ) } right: {(SQ <"hello bar">)} ) ) ] action: [(C {(err_exit)} {(SQ <"foo \\bar, where foo is alias for \"print hello \" failed">)})] spids: [-1 282] ) ] spids: [-1 290] ) (C {(alias)} {(Lit_VarLike "bar=") (SQ <"foo world">)}) (If arms: [ (if_arm cond: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: { (CommandSubPart command_list: (CommandList children:[(C {(bar)})]) left_token: <Left_CommandSub "$("> spids: [303 305] ) } right: {(SQ <"hello world">)} ) ) ] action: [(C {(err_exit)} {(SQ <"bar, where bar is alias for \"foo world\" failed">)})] spids: [-1 315] ) ] spids: [-1 323] ) (If arms: [ (if_arm cond: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: { (CommandSubPart command_list: (CommandList children:[(C {(alias)} {(bar)})]) left_token: <Left_CommandSub "$("> spids: [329 333] ) } right: {(DQ ("bar='foo world'"))} ) ) ] action: [(C {(err_exit)} {(SQ <"alias bar, where bar is alias for \"foo world\" failed">)})] spids: [-1 343] ) ] spids: [-1 351] ) (AndOr children: [(C {(unalias)} {(foo)}) (C {(err_exit)} {(DQ ("unalias foo failed"))})] op_id: Op_DPipe ) (AndOr children: [ (SimpleCommand words: [{(alias)} {(foo)}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[369])] ) (C {(err_exit)} {(DQ ("alias for non-existent alias foo returns true"))}) ] op_id: Op_DAmp ) (C {(unset)} {(bar)}) (C {(alias)} {(Lit_VarLike "bar=") (DQ ("print foo") ($ VSub_Name "$bar"))}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:bar) op:Equal rhs:{(bar)} spids:[393])] spids: [393] ) (If arms: [ (if_arm cond: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: { (CommandSubPart command_list: (CommandList children:[(C {(bar)})]) left_token: <Left_CommandSub "$("> spids: [400 402] ) } right: {(foo)} ) ) ] action: [ (C {(err_exit)} {(SQ <"alias bar, where bar is alias for \"print foo$bar\" failed">)}) ] spids: [-1 410] ) ] spids: [-1 418] ) (C {(unset)} {(bar)}) (C {(alias)} {(Lit_VarLike "bar=") (SQ <"print hello">)}) (If arms: [ (if_arm cond: [(DBracket expr:(BoolBinary op_id:BoolBinary_GlobNEqual left:{($ VSub_Name "$bar")} right:{(SQ )}))] action: [(C {(err_exit)} {(SQ <"alias bar cause variable bar to be set">)})] spids: [-1 444] ) ] spids: [-1 452] ) (C {(alias)} {(KW_Bang "!") (KW_Bang "!") (Lit_Other "=") (print)}) (If arms: [ (if_arm cond: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: { (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [{(KW_Bang "!") (KW_Bang "!")} {(hello)}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [471] ) ] ) ] ) left_token: <Left_CommandSub "$("> spids: [465 473] ) } right: {(hello)} ) ) ] action: [(C {(err_exit)} {(SQ <"alias for !!=print not working">)})] spids: [-1 481] ) ] spids: [-1 489] ) (C {(alias)} {(Lit_VarLike "foo=") (echo)}) (If arms: [ (if_arm cond: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: { (CommandSubPart command_list: (CommandList children: [ (C {(print)} { (DQ (CommandSubPart command_list: (CommandList children:[(C {(foo)} {(bar)})]) left_token: <Left_CommandSub "$("> spids: [504 508] ) ) } ) ] ) left_token: <Left_CommandSub "$("> spids: [500 511] ) } right: {(bar)} ) ) ] action: [(C {(err_exit)} {(SQ <"alias in command substitution not working">)})] spids: [-1 519] ) ] spids: [-1 527] ) (Subshell child:(C {(unalias)} {(foo)}) spids:[529534]) (If arms: [ (if_arm cond: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobNEqual left: { (CommandSubPart command_list: (CommandList children: [ (SimpleCommand words: [{(foo)} {(bar)}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [545] ) ] ) ] ) left_token: <Left_CommandSub "$("> spids: [540 548] ) } right: {(bar)} ) ) ] action: [(C {(err_exit)} {(SQ <"alias not working after unalias in subshell">)})] spids: [-1 556] ) ] spids: [-1 564] ) (SimpleCommand words: [{(builtin)} {(-d)} {(rm)}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[572])] ) (If arms: [ (if_arm cond: [ (SimpleCommand words: [{(whence)} {(rm)}] redirects: [(Redir op_id:Redir_Great fd:-1 arg_word:{(/dev/null)} spids:[582])] ) ] action: [ (AndOr children: [ (DBracket expr: (LogicalNot child: (WordTest w: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(alias)} {(-t)}) (C {(grep)} {(Lit_VarLike "rm=")}) ] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [592 603] ) } ) ) ) (C {(err_exit)} {(SQ <"tracked alias not set">)}) ] op_id: Op_DAmp ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PATH) op: Equal rhs: {($ VSub_Name "$PATH")} spids: [616] ) ] spids: [616] ) (AndOr children: [ (DBracket expr: (WordTest w: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [(C {(alias)} {(-t)}) (C {(grep)} {(Lit_VarLike "rm=")})] negated: False ) ] ) left_token: <Left_CommandSub "$("> spids: [622 633] ) } ) ) (C {(err_exit)} {(SQ <"tracked alias not cleared">)}) ] op_id: Op_DAmp ) ] spids: [-1 586] ) ] spids: [-1 645] ) (If arms: [ (if_arm cond: [ (AndOr children: [ (SimpleCommand words: [{(hash)} {(-r)}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[653])] ) (DBracket expr: (LogicalNot child: (WordTest w: { (CommandSubPart command_list: (CommandList children:[(C {(hash)})]) left_token: <Left_CommandSub "$("> spids: [662 664] ) } ) ) ) ] op_id: Op_DAmp ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:PATH) op: Equal rhs: {($ VSub_Name "$tmp") (Lit_Other ":") (/bin) (Lit_Other ":") (/usr/bin)} spids: [670] ) ] spids: [670] ) (ForEach iter_name: i iter_words: [{(foo)} {(-foo)} {(--)}] do_arg_iter: False body: (DoGroup children: [ (SimpleCommand words: [{(print)} {(SQ <":">)}] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {($ VSub_Name "$tmp") (/) ($ VSub_Name "$i")} spids: [699] ) ] ) (C {(chmod)} {(Lit_Other "+") (x)} {($ VSub_Name "$tmp") (/) ($ VSub_Name "$i")}) (AndOr children: [ (SimpleCommand words: [{(hash)} {(-r)} {(--)} {($ VSub_Name "$i")}] redirects: [ (Redir op_id: Redir_Great fd: 2 arg_word: {(/dev/null)} spids: [724] ) ] ) (C {(err_exit)} {(DQ ("hash -r -- ") ($ VSub_Name "$i") (" failed"))}) ] op_id: Op_DPipe ) (AndOr children: [ (DBracket expr: (BoolBinary op_id: BoolBinary_GlobDEqual left: { (CommandSubPart command_list: (CommandList children:[(C {(hash)})]) left_token: <Left_CommandSub "$("> spids: [740 742] ) } right: {($ VSub_Name "$i") (BoolBinary_GlobEqual "=") ($ VSub_Name "$tmp") (/) ($ VSub_Name "$i") } ) ) (C {(err_exit)} { (DQ ("hash -r -- ") ($ VSub_Name "$i") (" failed, expected ") ($ VSub_Name "$i") ("=") ($ VSub_Name "$tmp") (/) ($ VSub_Name "$i") (", got ") (CommandSubPart command_list: (CommandList children:[(C {(hash)})]) left_token: <Left_CommandSub "$("> spids: [768 770] ) ) } ) ] op_id: Op_DPipe ) ] spids: [691 774] ) spids: [683 -1] ) ] spids: [-1 668] ) ] else_action: [(C {(err_exit)} {(SQ <"hash -r failed">)})] spids: [776 784] ) (AndOr children: [ (Subshell child: (C {(alias)} {(Lit_Other ":") (Lit_VarLike "pr=") (print)}) redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[795])] spids: [786 793] ) (C {(err_exit)} {(SQ <"alias beginning with : fails">)}) ] op_id: Op_DPipe ) (AndOr children: [ (Subshell child: (C {(alias)} {(p) (Lit_Other ":") (Lit_VarLike "r=") (print)}) redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[817])] spids: [807 815] ) (C {(err_exit)} {(SQ <"alias with : in name fails">)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(unalias)} {(no_such_alias)}) (C {(err_exit)} {(SQ <"unalias should return non-zero for unknown alias">)}) ] op_id: Op_DAmp ) (C {(exit)} { (ArithSubPart anode: (TernaryOp cond: (ArithBinary op_id: Arith_Less left: (ArithVarRef name:Errors) right: (ArithWord w:{(Lit_Digits 125)}) ) true_expr: (ArithVarRef name:Errors) false_expr: (ArithWord w:{(Lit_Digits 125)}) ) spids: [845 854] ) } ) ] )