(command.CommandList children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_Pound '$#'))} {(-lt)} {(DQ (2))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:96) ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ('Usage: ') (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:105) command_list: (command.CommandList children: [(C {(basename)} {($ Id.VSub_Number '$0')})] ) ) (' timeout_in_seconds command') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:115) fd: -1 arg_word: {(2)} ) ] ) (command.Simple words: [ {(echo)} { (DQ ('Example: ') (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:123) command_list: (command.CommandList children: [(C {(basename)} {($ Id.VSub_Number '$0')})] ) ) (' 2 sleep 3 || echo timeout') ) } ] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:133) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:137) arg_word: {(1)} ) ] spids: [81 98] ) ] ) (command.ShFunction name: cleanup body: (command.BraceGroup children: [ (C {(trap)} {(-)} {(ALRM)}) (command.Simple words: [{(kill)} {(-ALRM)} {($ Id.VSub_DollarName '$a')}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:167) fd: 2 arg_word: {(/dev/null)} ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.Simple words: [{(kill)} {($ Id.VSub_Bang '$!')}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:178) fd: 2 arg_word: {(/dev/null)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:187) arg_word: {(124)} ) ] ) ] ) ) (command.ShFunction name: watchit body: (command.BraceGroup children: [ (C {(trap)} {(DQ (cleanup))} {(ALRM)}) (command.Sentence child: (C {(sleep)} {($ Id.VSub_Number '$1')}) terminator: (Token id:Id.Op_Amp val:'&' span_id:216) ) (C {(wait)}) (C {(kill)} {(-ALRM)} {($ Id.VSub_Dollar '$$')}) ] ) ) (command.CommandList children: [ (command.Sentence child: (C {(watchit)} {($ Id.VSub_Number '$1')}) terminator: (Token id:Id.Op_Amp val:'&' span_id:233) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:a) op: assign_op.Equal rhs: {($ Id.VSub_Bang '$!')} spids: [235] ) ] ) ] ) (C {(shift)}) (C {(trap)} {(DQ (cleanup))} {(ALRM)} {(INT)}) (command.CommandList children: [ (command.Sentence child: (C {(DQ ($ Id.VSub_At '$@'))}) terminator: (Token id:Id.Op_Amp val:'&' span_id:262) ) (command.Sentence child: (C {(wait)} {($ Id.VSub_Bang '$!')}) terminator: (Token id:Id.Op_Semi val:';' span_id:267) ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:RET) op: assign_op.Equal rhs: {($ Id.VSub_QMark '$?')} spids: [269] ) ] ) ] ) (C {(kill)} {(-ALRM)} {($ Id.VSub_DollarName '$a')}) (C {(wait)} {($ Id.VSub_DollarName '$a')}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:291) arg_word: {($ Id.VSub_DollarName '$RET')} ) ] )