#!../../bash # $Id: subshell.sh,v 1.1 2008/08/22 18:54:08 rockyb Exp $ # Test debugger handling of lines with multiple commands per line # and subshells in a line global x := '1'; global y := '2'; global z := '3' shell {builtin cd . ; global x := $[builtin echo *]; shell {builtin echo "ho"} } matchstr $[builtin echo "testing"; builtin echo 1,2,3],$[builtin echo 1,2,3] { *c*,-n* { global ECHO_N := '', ECHO_C := '' ',' ECHO_T := '' '' } *c*,* { global ECHO_N := '-n', ECHO_C := '', ECHO_T := '' } * { global ECHO_N := '', ECHO_C := ''\c',' ECHO_T := '' } } shell {builtin cd . ; global x := $[builtin echo *]; shell {builtin echo "ho"} } global x := '5'; global y := '6'; (CommandList children: [ (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:x) op:Equal rhs:{(1)} spids:[13])] spids: [13] ) terminator: ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:y) op:Equal rhs:{(2)} spids:[17])] spids: [17] ) terminator: ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:z) op:Equal rhs:{(3)} spids:[21])] spids: [21] ) (Subshell child: (CommandList children: [ (Sentence child:(C {(builtin)} {(cd)} {(.)}) terminator:) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:x) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(builtin)} {(echo)} {(Lit_Other "*")})] ) left_token: spids: [34 40] ) } spids: [33] ) ] spids: [33] ) terminator: ) (Subshell child:(C {(builtin)} {(echo)} {(DQ (ho))}) spids:[4351]) ] ) spids: [24 53] ) (Case to_match: { (CommandSubPart command_list: (CommandList children: [ (Sentence child: (C {(builtin)} {(echo)} {(DQ (testing))}) terminator: ) (C {(builtin)} {(echo)} {(1) (Lit_Comma ",") (2) (Lit_Comma ",") (3)}) ] ) left_token: spids: [57 76] ) (Lit_Comma ",") (CommandSubPart command_list: (CommandList children: [(C {(builtin)} {(echo)} {(1) (Lit_Comma ",") (2) (Lit_Comma ",") (3)})] ) left_token: spids: [78 88] ) } arms: [ (case_arm pat_list: [{(Lit_Other "*") (c) (Lit_Other "*") (Lit_Comma ",") (-n) (Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ECHO_N) op: Equal rhs: {(SQ )} spids: [101] ) (assign_pair lhs: (LhsName name:ECHO_C) op: Equal rhs: {(SQ <"\n">)} spids: [103] ) (assign_pair lhs: (LhsName name:ECHO_T) op: Equal rhs: {(SQ <"\t">)} spids: [108] ) ] spids: [101] ) ] spids: [93 99 113 -1] ) (case_arm pat_list: [{(Lit_Other "*") (c) (Lit_Other "*") (Lit_Comma ",") (Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ECHO_N) op: Equal rhs: {(-n)} spids: [124] ) (assign_pair lhs: (LhsName name:ECHO_C) op: Equal rhs: {(SQ )} spids: [127] ) (assign_pair lhs: (LhsName name:ECHO_T) op: Equal rhs: {(SQ )} spids: [129] ) ] spids: [124] ) ] spids: [116 122 131 -1] ) (case_arm pat_list: [{(Lit_Other "*")}] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:ECHO_N) op: Equal rhs: {(SQ )} spids: [137] ) (assign_pair lhs: (LhsName name:ECHO_C) op: Equal rhs: {(SQ <"\\c">)} spids: [139] ) (assign_pair lhs: (LhsName name:ECHO_T) op: Equal rhs: {(SQ )} spids: [144] ) ] spids: [137] ) ] spids: [134 135 146 -1] ) ] spids: [55 90 148] ) (Subshell child: (CommandList children: [ (Sentence child:(C {(builtin)} {(cd)} {(.)}) terminator:) (Sentence child: (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:x) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [(C {(builtin)} {(echo)} {(Lit_Other "*")})] ) left_token: spids: [161 167] ) } spids: [160] ) ] spids: [160] ) terminator: ) (Subshell child:(C {(builtin)} {(echo)} {(DQ (ho))}) spids:[170178]) ] ) spids: [151 180] ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:x) op:Equal rhs:{(5)} spids:[183])] spids: [183] ) terminator: ) (Sentence child: (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:y) op:Equal rhs:{(6)} spids:[187])] spids: [187] ) terminator: ) ] )