(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.DParen left: <Id.Op_DLeftParen _> child: (arith_expr.BinaryAssign op_id: Id.Arith_PlusEqual left: ($ Id.Lit_ArithVarLike Errors) right: {<Id.Lit_Digits 1>} ) right: <Id.Op_DRightParen _> redirects: [] ) ] 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.Simple blame_tok: <Id.KW_Enum enum> more_env: [] words: [ {<Id.KW_Enum enum>} {<Id.Lit_VarLike 'Color_t='> (ShArrayLiteral left: <Id.Op_LParen _> words: [{<red>} {<green>} {<blue>} {<orange>} {<yellow>}] right: <Id.Right_ShArrayLiteral _> ) } ] redirects: [] do_fork: T ) (command.Simple blame_tok: <Id.KW_Enum enum> more_env: [] words: [ {<Id.KW_Enum enum>} {<-i>} {<Id.Lit_VarLike 'Sex_t='> (ShArrayLiteral left: <Id.Op_LParen _> words: [{<Male>} {<Female>}] right: <Id.Right_ShArrayLiteral _> ) } ] redirects: [] do_fork: T ) (command.ForExpr keyword: <Id.KW_For for> init: (arith_expr.BinaryAssign op_id: Id.Arith_Equal left: ($ Id.Lit_ArithVarLike i) right: {<Id.Lit_Digits 0>} ) cond: (arith_expr.Binary op_id: Id.Arith_Less left: ($ Id.Lit_ArithVarLike i) right: {<Id.Lit_Digits 1000>} ) update: (arith_expr.UnaryAssign op_id:Id.Node_PostDPlus child:($ Id.Lit_ArithVarLike i)) body: (command.DoGroup left: <Id.KW_Do do> children: [ (command.Simple blame_tok: <Color_t> more_env: [] words: [{<Color_t>} {<x>}] redirects: [] do_fork: T ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName x)} right: {<red>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'Color_t does not default to red'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.ShAssignment left: <Id.Lit_VarLike 'x='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'x='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'x='> name:x) op: assign_op.Equal rhs: {<orange>} ) ] redirects: [] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName x)} right: {<orange>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'$x should be orange'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.AndOr children: [ (command.Subshell left: <Id.Op_LParen _> child: (command.ShAssignment left: <Id.Lit_VarLike 'x='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'x='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'x='> name:x) op: assign_op.Equal rhs: {<violet>} ) ] redirects: [] ) right: <Id.Right_Subshell _> redirects: [ (Redir op: <Id.Redir_Great '2>'> loc: (redir_loc.Fd fd:2) arg: {<'/dev/null'>} ) ] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'x=violet should fail'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DAmp _>] ) (command.ShAssignment left: <Id.Lit_ArrayLhsOpen 'x['> pairs: [ (AssignPair left: <Id.Lit_ArrayLhsOpen 'x['> lhs: (sh_lhs_expr.IndexedName left: <Id.Lit_ArrayLhsOpen 'x['> name: x index: {<Id.Lit_Digits 2>} ) op: assign_op.Equal rhs: {<green>} ) ] redirects: [] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name x> var_name: x bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 2>}) right: <Id.Right_DollarBrace '}'> ) } right: {<green>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'${x[2]} should be green'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.AndOr children: [ (command.DParen left: <Id.Op_DLeftParen _> child: (arith_expr.Binary op_id: Id.Arith_DEqual left: (arith_expr.Binary op_id: Id.Arith_LBracket left: ($ Id.Lit_ArithVarLike x) right: {<Id.Lit_Digits 2>} ) right: {<Id.Lit_Digits 1>} ) right: <Id.Op_DRightParen _> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'((x[2]!=1))'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (word_part.ArithSub left: <Id.Left_DollarDParen '$(('> anode: (arith_expr.Binary op_id: Id.Arith_LBracket left: ($ Id.Lit_ArithVarLike x) right: {<Id.Lit_Digits 2>} ) right: <Id.Right_DollarDParen _> ) } right: {<1>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'$((x[2]))!=1'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName x)} right: {<orange>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'$x is no longer orange'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.Simple blame_tok: <Color_t> more_env: [] words: [{<Color_t>} {<-A>} {<y>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_ArrayLhsOpen 'y['> pairs: [ (AssignPair left: <Id.Lit_ArrayLhsOpen 'y['> lhs: (sh_lhs_expr.IndexedName left: <Id.Lit_ArrayLhsOpen 'y['> name: y index: ($ Id.Lit_ArithVarLike foo) ) op: assign_op.Equal rhs: {<yellow>} ) ] redirects: [] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name y> var_name: y bracket_op: (bracket_op.ArrayIndex expr:($ Id.Lit_ArithVarLike foo)) right: <Id.Right_DollarBrace '}'> ) } right: {<yellow>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'${y[foo]} != yellow'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.AndOr children: [ (command.DParen left: <Id.Op_DLeftParen _> child: (arith_expr.Binary op_id: Id.Arith_DEqual left: (arith_expr.Binary op_id: Id.Arith_LBracket left: ($ Id.Lit_ArithVarLike y) right: ($ Id.Lit_ArithVarLike foo) ) right: {<Id.Lit_Digits 4>} ) right: <Id.Op_DRightParen _> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'(( y[foo] != 4))'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.Simple blame_tok: <unset> more_env: [] words: [{<unset>} {<y>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <typeset> more_env: [] words: [{<typeset>} {<-a>} {<Id.Lit_LBracket '['> <Color_t> <Id.Lit_RBracket ']'>} {<z>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_ArrayLhsOpen 'z['> pairs: [ (AssignPair left: <Id.Lit_ArrayLhsOpen 'z['> lhs: (sh_lhs_expr.IndexedName left: <Id.Lit_ArrayLhsOpen 'z['> name: z index: ($ Id.Lit_ArithVarLike green) ) op: assign_op.Equal rhs: {<xyz>} ) ] redirects: [] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name z> var_name: z bracket_op: (bracket_op.ArrayIndex expr:($ Id.Lit_ArithVarLike green)) right: <Id.Right_DollarBrace '}'> ) } right: {<xyz>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'${z[green]} should be xyz'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name z> var_name: z bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 1>}) right: <Id.Right_DollarBrace '}'> ) } right: {<xyz>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'${z[1]} should be xyz'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.ShAssignment left: <Id.Lit_ArrayLhsOpen 'z['> pairs: [ (AssignPair left: <Id.Lit_ArrayLhsOpen 'z['> lhs: (sh_lhs_expr.IndexedName left: <Id.Lit_ArrayLhsOpen 'z['> name: z index: ($ Id.Lit_ArithVarLike orange) ) op: assign_op.Equal rhs: {<bam>} ) ] redirects: [] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name z> var_name: z prefix_op: <Id.VSub_Bang '!'> bracket_op: (bracket_op.WholeArray op_id:Id.Lit_At) right: <Id.Right_DollarBrace '}'> ) } right: {(SQ <'green orange'>)} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'${!z[@]} == "green orange"'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.Simple blame_tok: <unset> more_env: [] words: [{<unset>} {<x>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <Sex_t> more_env: [] words: [{<Sex_t>} {<x>}] redirects: [] do_fork: T ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName x)} right: {<Male>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'Sex_t not defaulting to Male'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.ShAssignment left: <Id.Lit_VarLike 'x='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'x='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'x='> name:x) op: assign_op.Equal rhs: {<female>} ) ] redirects: [] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName x)} right: {<Female>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'Sex_t not case sensitive'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.Simple blame_tok: <unset> more_env: [] words: [{<unset>} {<x>} {<y>} {<z>}] redirects: [] do_fork: T ) ] right: <Id.KW_Done done> ) redirects: [] ) (command.Subshell left: <Id.Op_LParen _> child: (command.CommandList children: [ (command.Simple blame_tok: <typeset> more_env: [] words: [ {<typeset>} {<-T>} {<Id.Lit_VarLike 'X_t='> (ShArrayLiteral left: <Id.Op_LParen _> words: [{<typeset>} {<Id.Lit_VarLike 'name='> <aha>}] right: <Id.Right_ShArrayLiteral _> ) } ] redirects: [] do_fork: T ) (command.Simple blame_tok: <typeset> more_env: [] words: [{<typeset>} {<-a> <Id.Lit_LBracket '['> <X_t> <Id.Lit_RBracket ']'>} {<arr>}] redirects: [] do_fork: T ) ] ) right: <Id.Right_Subshell _> redirects: [(Redir op:<Id.Redir_Great '2>'> loc:(redir_loc.Fd fd:2) arg:{<'/dev/null'>})] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_QMark '?')} right: {<1>} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [ {<err_exit>} { (SQ < 'typeset -a[X_t] should generate an error message when X-t is not an enumeriation type' > ) } ] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.Simple blame_tok: <typeset> more_env: [] words: [{<typeset>} {<-a>} {<Id.Lit_LBracket '['> <Color_t> <Id.Lit_RBracket ']'>} {<arr>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_ArrayLhsOpen 'arr['> pairs: [ (AssignPair left: <Id.Lit_ArrayLhsOpen 'arr['> lhs: (sh_lhs_expr.IndexedName left: <Id.Lit_ArrayLhsOpen 'arr['> name: arr index: ($ Id.Lit_ArithVarLike green) ) op: assign_op.Equal rhs: {<foo>} ) ] redirects: [] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name arr> var_name: arr bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 1>}) right: <Id.Right_DollarBrace '}'> ) } right: { (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name arr> var_name: arr bracket_op: (bracket_op.ArrayIndex expr:($ Id.Lit_ArithVarLike green)) right: <Id.Right_DollarBrace '}'> ) } ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'arr[1] != arr[green]'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (command.Simple blame_tok: <read> more_env: [] words: [{<read>} {<-A>} {<arr>}] redirects: [(Redir op:<Id.Redir_TLess '<<<'> loc:(redir_loc.Fd fd:0) arg:{(SQ <'x y z xx yy'>)})] do_fork: T ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: { (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name arr> var_name: arr bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 1>}) right: <Id.Right_DollarBrace '}'> ) } right: { (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name arr> var_name: arr bracket_op: (bracket_op.ArrayIndex expr:($ Id.Lit_ArithVarLike green)) right: <Id.Right_DollarBrace '}'> ) } ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.Simple blame_tok: <err_exit> more_env: [] words: [{<err_exit>} {(SQ <'arr[1] != arr[green] after read'>)}] redirects: [] do_fork: T ) ] ops: [<Id.Op_DPipe _>] ) (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 _> ) } ) ] )