(command.CommandList children: [ (command.ShFunction name: printUsageAndExit body: (BraceGroup children: [ (C {<echo>} {(DQ <'Usage:'>)}) (C {<echo>} {(DQ <'./RemoteRunSafely.sh <hostname> [-l <login_name>] [-p <port>] '>)} {(DQ <'<program> <args...>'>)} ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<255>}) ] ) ) (command.ShFunction name: moreArgsExpected body: (BraceGroup children: [ (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Number '$1')} {<-lt>} {($ Id.VSub_Number '$2')} {<Id.Lit_RBracket ']'>} ) ] ) action: [ (C {<echo>} {(DQ <'Error: Wrong number of argumants.'>)}) (C {<printUsageAndExit>}) ] spids: [110 123] ) ] ) ] ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ORIG_ARGS) op: assign_op.Equal rhs: {(DQ ($ Id.VSub_Star '$*'))} spids: [147] ) ] ) (C {<moreArgsExpected>} {($ Id.VSub_Pound '$#')} {<1>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:RHOST) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [162] ) ] ) (C {<shift>} {<1>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:RUSER) op: assign_op.Equal rhs: {(command_sub left_token:<Id.Left_Backtick '`'> child:(C {<id>} {<-un>}))} spids: [170] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:RCLIENT) op: assign_op.Equal rhs: {<ssh>} spids: [179] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:RPORT) op: assign_op.Equal rhs: (word.Empty) spids: [182] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:WORKING_DIR) op: assign_op.Equal rhs: (word.Empty) spids: [184] ) ] ) (C {<moreArgsExpected>} {($ Id.VSub_Pound '$#')} {<1>}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Number '$1')} {<Id.Lit_Equals '='>} {(DQ <-l>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<moreArgsExpected>} {($ Id.VSub_Pound '$#')} {<2>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:RUSER) op: assign_op.Equal rhs: {($ Id.VSub_Number '$2')} spids: [218] ) ] ) (C {<shift>} {<2>}) ] spids: [193 208] ) ] ) (C {<moreArgsExpected>} {($ Id.VSub_Pound '$#')} {<1>}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {($ Id.VSub_Number '$1')} {<Id.Lit_Equals '='>} {(DQ <-p>)} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<moreArgsExpected>} {($ Id.VSub_Pound '$#')} {<2>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:RPORT) op: assign_op.Equal rhs: {(DQ <'-p '> ($ Id.VSub_Number '$2'))} spids: [259] ) ] ) (C {<shift>} {<2>}) ] spids: [234 249] ) ] ) (C {<moreArgsExpected>} {($ Id.VSub_Pound '$#')} {<1>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:PROGRAM) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<basename>} {($ Id.VSub_Number '$1')}) ) } spids: [279] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:WORKING_DIR) op: assign_op.Equal rhs: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<dirname>} {($ Id.VSub_Number '$1')}) ) } spids: [286] ) ] ) (C {<shift>} {<1>}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {(DQ ($ Id.VSub_DollarName '$RHOST'))} {<Id.Lit_Equals '='>} {(DQ )} {<-o>} {(DQ ($ Id.VSub_DollarName '$PROGRAM'))} {<Id.Lit_Equals '='>} {(DQ )} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [(C {<printUsageAndExit>})] spids: [320 347] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:local_program) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$WORKING_DIR') (DQ <'/'>) ($ Id.VSub_DollarName '$PROGRAM')} spids: [358] ) ] ) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} {<Id.KW_Bang '!'>} {<-x>} {(DQ ($ Id.VSub_DollarName '$local_program'))} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (C {<echo>} {(DQ <'File '>) ($ Id.VSub_DollarName '$local_program') (DQ <' does not exist or is not an executable..'>) } ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<255>}) ] spids: [365 380] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:connection) op: assign_op.Equal rhs: {($ Id.VSub_DollarName '$RUSER') (SQ <'@'>) ($ Id.VSub_DollarName '$RHOST')} spids: [401] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:remote) op: assign_op.Equal rhs: {(DQ <'./'>) ($ Id.VSub_DollarName '$PROGRAM')} spids: [408] ) ] ) (command.Subshell child: (command.Pipeline children: [ (C {<cat>} {($ Id.VSub_DollarName '$local_program')}) (C {($ Id.VSub_DollarName '$RCLIENT')} {($ Id.VSub_DollarName '$connection')} {($ Id.VSub_DollarName '$RPORT')} {(SQ <'rm -f '>) ($ Id.VSub_DollarName '$remote') (SQ <' ; '>)} {(SQ <'cat > '>) ($ Id.VSub_DollarName '$remote') (SQ <' ; chmod +x '>) ($ Id.VSub_DollarName '$remote') (SQ <' ; '>) ($ Id.VSub_DollarName '$remote') (SQ <' '>) ($ Id.VSub_Star '$*') (SQ <' ; '>) } {(SQ <'err=$? ; rm -f '>) ($ Id.VSub_DollarName '$remote') (SQ <' ; exit $err'>)} ) ] negated: F ) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:err) op: assign_op.Equal rhs: {($ Id.VSub_QMark '$?')} spids: [475] ) ] ) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{($ Id.VSub_DollarName '$err')}) ] )