(command.CommandList children: [ (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_Number 0)} right: { (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name BASH_SOURCE> var_name: BASH_SOURCE bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 0>}) right: <Id.Right_DollarBrace '}'> ) } ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.ShAssignment left: <Id.Lit_VarLike 'dirname='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'dirname='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'dirname='> name:dirname) op: assign_op.Equal rhs: { (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name BASH_SOURCE> var_name: BASH_SOURCE bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 0>}) suffix_op: (suffix_op.Unary op: <Id.VOp1_Percent '%'> arg_word: {<Id.Lit_Slash '/'> <Id.Lit_Other '*'>} ) right: <Id.Right_DollarBrace '}'> ) } ) ] redirects: [] ) (command.AndOr children: [ (command.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_DollarName dirname)} right: {($ Id.VSub_Number 0)} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) (command.ShAssignment left: <Id.Lit_VarLike 'top_dir='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'top_dir='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'top_dir='> name:top_dir) op: assign_op.Equal rhs: {(SQ <..>)} ) ] redirects: [] ) (command.ShAssignment left: <Id.Lit_VarLike 'top_dir='> pairs: [ (AssignPair left: <Id.Lit_VarLike 'top_dir='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike 'top_dir='> name:top_dir) op: assign_op.Equal rhs: {(${ Id.VSub_Name dirname) <'/..'>} ) ] redirects: [] ) ] ops: [<Id.Op_DAmp _> <Id.Op_DPipe _>] ) (command.ForEach keyword: <Id.KW_For for> iter_names: [lib_file] iterable: (for_iter.Words words:[{<help>} {<alias>}]) semi_tok: <Id.Op_Semi _> body: (command.DoGroup left: <Id.KW_Do do> children: [ (command.Sentence child: (command.Simple blame_tok: <source> more_env: [] words: [ {<source>} {($ Id.VSub_DollarName top_dir) <'/lib/'> (${ Id.VSub_Name lib_file) <.sh>} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] right: <Id.KW_Done done> ) redirects: [] ) ] spids: [61 80] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.Simple blame_tok: <_Dbg_help_add> more_env: [] words: [ {<_Dbg_help_add>} {(SQ <examine>)} { (DQ <'**examine** *expr*\n'> <'\n'> <'Print value of an expression via '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') <typeset> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') <', '> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') <let> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') <', and failing these,\n'> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') <eval> (word_part.EscapedLiteral token:<Id.Lit_EscapedChar '\\"'> ch:'"') <'.\n'> <'\n'> <'To see the structure of a variable do not prepeand a leading '> <Id.Lit_Dollar '$'> <'.\n'> <'\n'> <'Arithmetic expressions also do not need leading '> <Id.Lit_Dollar '$'> <' for\n'> <'their value is to be substituted.\n'> <'\n'> <'However if *expr* falls into neither these, categories variables\n'> <'witih *expr* need '> <Id.Lit_Dollar '$'> <' to have their value substituted.\n'> <'\n'> <'Examples:\n'> <'---------\n'> <'\n'> <' # code:\n'> <' # typeset -a typeset -a x=(2 3 4)\n'> <' # typeset -ir p=1\n'> <' bashdb<1> examine x # note no '> <Id.Lit_Dollar '$'> <'\n'> <' declare -a x=\'([0]='> ) <2> (DQ <' [1]='>) <3> (DQ <' [2]='>) <4> (DQ <')\'\n'> <' bashdb<2> examine '> ($ Id.VSub_DollarName x) <' # note with '> <Id.Lit_Dollar '$'> <'\n'> <' 1 # because this is how bash evaluates '> ($ Id.VSub_DollarName x) <'\n'> <' bashdb<3> x p\n'> <' declare -ir p='> ) <1> (DQ <'\n'> <' bashdb<3> x p+2\n'> <' 3\n'> <' bashdb<3> x '> ($ Id.VSub_DollarName p) <'+2\n'> <' 3\n'> <'\n'> <'See also:\n'> <'---------\n'> <'\n'> <'**eval** and **pr**.'> ) } ] redirects: [] do_fork: T ) (command.ShFunction keyword: <Id.KW_Function function> name_tok: <_Dbg_do_examine> name: _Dbg_do_examine body: (BraceGroup left: <Id.Lit_LBrace '{'> children: [ (command.Simple blame_tok: <typeset> more_env: [] words: [ {<typeset>} {<-r>} {<Id.Lit_VarLike '_Dbg_expr='> (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_At '@'> var_name: '@' suffix_op: (suffix_op.Unary op: <Id.VTest_ColonHyphen _> arg_word: {(DQ ($ Id.VSub_DollarName _Dbg_last_x_args))} ) right: <Id.Right_DollarBrace '}'> ) } ] redirects: [] do_fork: T ) (command.Simple blame_tok: <typeset> more_env: [] words: [{<typeset>} {<_Dbg_result>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <typeset> more_env: [] words: [{<typeset>} {<Id.Lit_VarLike 'isblank='> ($ Id.VSub_DollarName _Dbg_expr)}] 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.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Unary op_id: Id.BoolUnary_z child: {($ Id.VSub_DollarName isblank)} ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <_Dbg_msg> more_env: [] words: [{<_Dbg_msg>} {(DQ ($ Id.VSub_DollarName _Dbg_expr))}] redirects: [] do_fork: T ) ] spids: [270 282] ) (IfArm keyword: <Id.KW_Elif elif> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <_Dbg_defined> more_env: [] words: [{<_Dbg_defined>} {($ Id.VSub_DollarName _Dbg_expr)}] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.ShAssignment left: <Id.Lit_VarLike '_Dbg_result='> pairs: [ (AssignPair left: <Id.Lit_VarLike '_Dbg_result='> lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike '_Dbg_result='> name: _Dbg_result ) op: assign_op.Equal rhs: { (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <typeset> more_env: [] words: [{<typeset>} {<-p>} {($ Id.VSub_DollarName _Dbg_expr)}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) } ) ] redirects: [] ) (command.Simple blame_tok: <_Dbg_msg> more_env: [] words: [{<_Dbg_msg>} {(DQ ($ Id.VSub_DollarName _Dbg_result))}] redirects: [] do_fork: T ) ] spids: [292 300] ) (IfArm keyword: <Id.KW_Elif elif> cond: (condition.Shell commands: [ (command.Sentence child: (command.Simple blame_tok: <_Dbg_is_function> more_env: [] words: [ {<_Dbg_is_function>} {(DQ ($ Id.VSub_DollarName _Dbg_expr))} {($ Id.VSub_DollarName _Dbg_set_debug)} ] redirects: [] do_fork: T ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.ShAssignment left: <Id.Lit_VarLike '_Dbg_result='> pairs: [ (AssignPair left: <Id.Lit_VarLike '_Dbg_result='> lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike '_Dbg_result='> name: _Dbg_result ) op: assign_op.Equal rhs: { (CommandSub left_token: <Id.Left_DollarParen '$('> child: (command.Simple blame_tok: <typeset> more_env: [] words: [{<typeset>} {<-f>} {($ Id.VSub_DollarName _Dbg_expr)}] redirects: [] do_fork: T ) right: <Id.Eof_RParen _> ) } ) ] redirects: [] ) (command.Simple blame_tok: <_Dbg_msg> more_env: [] words: [{<_Dbg_msg>} {(DQ ($ Id.VSub_DollarName _Dbg_result))}] redirects: [] do_fork: T ) ] spids: [320 331] ) ] else_kw: <Id.KW_Else else> else_action: [ (command.Simple blame_tok: <typeset> more_env: [] words: [{<typeset>} {<-i>} {<_Dbg_rc>}] redirects: [] do_fork: T ) (command.Sentence child: (command.Simple blame_tok: <eval> more_env: [] words: [ {<eval>} {<let>} {<Id.Lit_VarLike '_Dbg_result='> ($ Id.VSub_DollarName _Dbg_expr)} ] redirects: [ (Redir op: <Id.Redir_Great '2>'> loc: (redir_loc.Fd fd:2) arg: {<'/dev/null'>} ) ] do_fork: T ) terminator: <Id.Op_Semi _> ) (command.ShAssignment left: <Id.Lit_VarLike '_Dbg_rc='> pairs: [ (AssignPair left: <Id.Lit_VarLike '_Dbg_rc='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike '_Dbg_rc='> name:_Dbg_rc) op: assign_op.Equal rhs: {($ Id.VSub_QMark '?')} ) ] redirects: [] ) (command.If if_kw: <Id.KW_If if> arms: [ (IfArm keyword: <Id.KW_If if> cond: (condition.Shell commands: [ (command.Sentence child: (command.DParen left: <Id.Op_DLeftParen _> child: (arith_expr.Binary op_id: Id.Arith_NEqual left: ($ Id.Lit_ArithVarLike _Dbg_rc) right: {<Id.Lit_Digits 0>} ) right: <Id.Op_DRightParen _> redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.Simple blame_tok: <_Dbg_do_print> more_env: [] words: [{<_Dbg_do_print>} {(DQ ($ Id.VSub_DollarName _Dbg_expr))}] redirects: [] do_fork: T ) ] spids: [376 391] ) ] else_kw: <Id.KW_Else else> else_action: [ (command.Simple blame_tok: <_Dbg_msg> more_env: [] words: [{<_Dbg_msg>} {(DQ ($ Id.VSub_DollarName _Dbg_result))}] redirects: [] do_fork: T ) ] fi_kw: <Id.KW_Fi fi> redirects: [] ) ] fi_kw: <Id.KW_Fi fi> redirects: [] ) (command.ShAssignment left: <Id.Lit_VarLike '_Dbg_last_x_args='> pairs: [ (AssignPair left: <Id.Lit_VarLike '_Dbg_last_x_args='> lhs: (sh_lhs_expr.Name left: <Id.Lit_VarLike '_Dbg_last_x_args='> name: _Dbg_last_x_args ) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_DollarName _Dbg_x_args))} ) ] redirects: [] ) (command.ControlFlow keyword:<Id.ControlFlow_Return return> arg_word:{<0>}) ] redirects: [] right: <Id.Lit_RBrace '}'> ) ) (command.Simple blame_tok: <_Dbg_alias_add> more_env: [] words: [{<_Dbg_alias_add>} {(SQ <x>)} {(SQ <examine>)}] 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.DBracket left: <Id.KW_DLeftBracket '[['> expr: (bool_expr.Binary op_id: Id.BoolBinary_GlobDEqual left: {($ Id.VSub_Number 0)} right: { (BracedVarSub left: <Id.Left_DollarBrace '${'> token: <Id.VSub_Name BASH_SOURCE> var_name: BASH_SOURCE bracket_op: (bracket_op.ArrayIndex expr:{<Id.Lit_Digits 0>}) right: <Id.Right_DollarBrace '}'> ) } ) right: <Id.Lit_DRightBracket ']]'> redirects: [] ) terminator: <Id.Op_Semi _> ) ] ) then_kw: <Id.KW_Then then> action: [ (command.ForEach keyword: <Id.KW_For for> iter_names: [_Dbg_file] iterable: (for_iter.Words words:[{<fns>} {<msg>}]) semi_tok: <Id.Op_Semi _> body: (command.DoGroup left: <Id.KW_Do do> children: [ (command.Simple blame_tok: <source> more_env: [] words: [ {<source>} {($ Id.VSub_DollarName top_dir) <'/lib/'> (${ Id.VSub_Name _Dbg_file) <.sh>} ] redirects: [] do_fork: T ) ] right: <Id.KW_Done done> ) redirects: [] ) (command.Simple blame_tok: <source> more_env: [] words: [{<source>} {($ Id.VSub_DollarName top_dir) <'/command/help.sh'>}] redirects: [] do_fork: T ) (command.ShAssignment left: <Id.Lit_VarLike '_Dbg_args='> pairs: [ (AssignPair left: <Id.Lit_VarLike '_Dbg_args='> lhs: (sh_lhs_expr.Name left:<Id.Lit_VarLike '_Dbg_args='> name:_Dbg_args) op: assign_op.Equal rhs: {(SQ <examine>)} ) ] redirects: [] ) (command.Simple blame_tok: <_Dbg_do_help> more_env: [] words: [{<_Dbg_do_help>} {<x>}] redirects: [] do_fork: T ) (command.Simple blame_tok: <_Dbg_do_examine> more_env: [] words: [{<_Dbg_do_examine>} {<top_dir>}] redirects: [] do_fork: T ) ] spids: [444 463] ) ] else_action: [] fi_kw: <Id.KW_Fi fi> redirects: [] ) ] )