(command.CommandList children: [ (C {(export)} {(Id.Lit_VarLike 'LANG=') (C)}) (C {(ulimit)} {(-c)} {(0)}) (C {(trap)} {(SQ )} {(TSTP)}) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:save_tty) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:122) command_list: (command.CommandList children:[(C {(stty)} {(-g)})]) ) } spids: [121] ) ] ) (C {(trap)} {(DQ ('stty ') ($ Id.VSub_DollarName '$save_tty'))} {(EXIT)}) ] ) (C {(stty)} {(quit)} {(SQ (Token id:Id.Lit_Chars val:' ' span_id:149))}) (C {(stty)} {(eof)} {(SQ (Token id:Id.Lit_Chars val:'?' span_id:160))}) (C {(stty)} {(-echo)}) (command.ShFunction name: cache_progs body: (command.BraceGroup children: [ (command.Simple words: [{(stty)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:183) fd: -1 arg_word: {(/dev/null)} ) ] ) (command.Simple words: [{(date)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:190) fd: -1 arg_word: {(/dev/null)} ) ] ) (command.Simple words: [{(grep)} {(.)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Less val:'<' span_id:199) fd: -1 arg_word: {(/dev/null)} ) ] ) (command.Subshell command_list: (command.CommandList children: [ (command.Pipeline children: [(C {(echo)} {(DQ ('import time'))}) (C {(python)})] negated: F ) ] ) redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:216) fd: 2 arg_word: {(/dev/null)} ) ] ) (command.Simple words: [{(bc)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Less val:'<' span_id:223) fd: -1 arg_word: {(/dev/null)} ) ] ) (command.Simple words: [{(sed)} {(SQ )}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Less val:'<' span_id:233) fd: -1 arg_word: {(/dev/null)} ) ] ) (command.Simple words: [{(printf)} {(SQ (Token id:Id.Lit_Chars val:1 span_id:241))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:244) fd: -1 arg_word: {(/dev/null)} ) ] ) (command.Simple words: [{(/usr/bin/time)} {(false)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:253) fd: 2 arg_word: {(/dev/null)} ) ] ) (command.Simple words: [{(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Less val:'<' span_id:260) fd: -1 arg_word: {(/dev/null)} ) ] ) ] ) ) (C {(cache_progs)}) (command.AndOr ops: [Id.Op_DAmp] children: [ (command.Pipeline children: [ (C {(date)} {(Id.Lit_Other '+') (Id.Lit_Other '%') (s.) (Id.Lit_Other '%') (N)}) (C {(grep)} {(-qF)} {(SQ (Token id:Id.Lit_Chars val:N span_id:287))}) ] negated: F ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:use_python) op: assign_op.Equal rhs: {(1)} spids: [292] ) ] ) ] ) (command.ShFunction name: now body: (command.BraceGroup children: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$use_python'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:314) ) ] action: [ (command.Pipeline children: [ (command.Simple words: [{(echo)} {(DQ ('import time; print time.time()'))}] redirects: [ (redir.Redir op: (Token id:Id.Redir_Great val:'2>' span_id:325) fd: 2 arg_word: {(/dev/null)} ) ] ) (C {(python)}) ] negated: F ) ] spids: [305 316] ) ] else_action: [ (C {(printf)} {(DQ ('%.2f'))} { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:342) command_list: (command.CommandList children: [ (C {(date)} {(Id.Lit_Other '+') (Id.Lit_Other '%') (s.) (Id.Lit_Other '%') (N)} ) ] ) ) } ) ] ) ] ) ) (command.ShFunction name: fmt_seconds body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:seconds) op: assign_op.Equal rhs: {($ Id.VSub_Number '$1')} spids: [367] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:mins) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:372) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ Id.VSub_DollarName '$seconds') (/60)}) (C {(bc)}) ] negated: F ) ] ) ) } spids: [371] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$mins'))} {(Id.KW_Bang '!') (Id.Lit_Equals '=')} {(DQ (0))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:402) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:seconds) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:408) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} { (DQ ($ Id.VSub_DollarName '$seconds') (' - (') ($ Id.VSub_DollarName '$mins') ('*60)') ) } ) (C {(bc)}) ] negated: F ) ] ) ) } spids: [407] ) ] ) (C {(echo)} {(DQ ($ Id.VSub_DollarName '$mins') (':') ($ Id.VSub_DollarName '$seconds'))} ) ] spids: [386 404] ) ] else_action: [(C {(echo)} {(DQ ($ Id.VSub_DollarName '$seconds'))})] ) ] ) ) (command.ShFunction name: total body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:end) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:458) command_list: (command.CommandList children:[(C {(now)})]) ) } spids: [457] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:total) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:466) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} { (DQ ($ Id.VSub_DollarName '$end') (' - ') ($ Id.VSub_DollarName '$start') ) } ) (C {(bc)}) ] negated: F ) ] ) ) } spids: [465] ) ] ) (C {(fmt_seconds)} {($ Id.VSub_DollarName '$total')}) ] ) ) (command.ShFunction name: stop body: (command.BraceGroup children: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_DollarName '$lapped'))} {(Id.Lit_RBracket ']')} ) (C {(lap)} {(DQ ($ Id.VSub_DollarName '$laptime'))} {(DQ (display))}) ] ) (C {(total)}) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:521) ) ] ) ) (command.ShFunction name: lap body: (command.BraceGroup children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:laptime) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:534) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(DQ ($ Id.VSub_Number '$1'))}) (C {(sed)} {(-n)} { (SQ (Token id: Id.Lit_Chars val: 's/.*real[^0-9.]*\\(.*\\)/\\1/p' span_id: 556 ) ) } ) ] negated: F ) ] ) ) } spids: [533] ) ] ) (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(DQ ($ Id.VSub_DollarName '$laptime'))} {(-o)} {(DQ ($ Id.VSub_DollarName '$laptime'))} {(Id.Lit_Equals '=')} {(DQ (0.00))} {(Id.Lit_RBracket ']')} ) (command.ControlFlow token: (Token id:Id.ControlFlow_Return val:return span_id:585) ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:laptotal) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:592) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ Id.VSub_DollarName '$laptime') (Id.Lit_Other '+') (0) ($ Id.VSub_DollarName '$laptotal') } ) (C {(bc)}) ] negated: F ) ] ) ) } spids: [591] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(DQ ($ Id.VSub_Number '$2'))} {(Id.Lit_Equals '=')} {(DQ (display))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:623) ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:lapcount) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:629) command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {(0) ($ Id.VSub_DollarName '$lapcount') (Id.Lit_Other '+') (1) } ) (C {(bc)}) ] negated: F ) ] ) ) } spids: [628] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:laptime) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:646) command_list: (command.CommandList children: [(C {(fmt_seconds)} {($ Id.VSub_DollarName '$laptotal')})] ) ) } spids: [645] ) ] ) (C {(echo)} {($ Id.VSub_DollarName '$laptime')} {(DQ ('(') ($ Id.VSub_DollarName '$lapcount') (')'))} ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:lapped) op: assign_op.Equal rhs: {(DQ (true))} spids: [666] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:laptotal) op: assign_op.Equal rhs: {(DQ (0))} spids: [672] ) ] ) ] spids: [608 625] ) ] ) ] ) ) (command.Simple words: [{(printf)} {(DQ ('Space for lap | ? for split | Ctrl-C to stop | Space to start...'))}] redirects: [ (redir.Redir op:(Token id:Id.Redir_GreatAnd val:'>&' span_id:688) fd:-1 arg_word:{(2)}) ] ) (command.WhileUntil keyword: (Token id:Id.KW_While val:while span_id:692) cond: [ (command.Sentence child: (C {(true)}) terminator: (Token id:Id.Op_Semi val:';' span_id:695) ) ] body: (command.DoGroup children: [ (C {(trap)} {(true)} {(INT)} {(QUIT)}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:laptime) op: assign_op.Equal rhs: { (command_sub left_token: (Token id:Id.Left_Backtick val:'`' span_id:713) command_list: (command.CommandList children: [ (command.Simple words: [{(/usr/bin/time)} {(-p)} {(cat)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'2>&' span_id:720) fd: 2 arg_word: {(1)} ) (redir.Redir op: (Token id:Id.Redir_Great val:'>' span_id:725) fd: -1 arg_word: {(/dev/null)} ) ] ) ] ) ) } spids: [712] ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:ret) op: assign_op.Equal rhs: {($ Id.VSub_QMark '$?')} spids: [730] ) ] ) (C {(trap)} {(SQ )} {(INT)} {(QUIT)}) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$ret')} {(-eq)} {(1)} {(-o)} {($ Id.VSub_DollarName '$ret')} {(-eq)} {(2)} {(-o)} {($ Id.VSub_DollarName '$ret')} {(-eq)} {(130)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:774) ) ] action: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(DQ ($ Id.VSub_DollarName '$start'))} {(Id.Lit_RBracket ']')} ) (command.BraceGroup children: [ (command.Sentence child: (command.Simple words: [{(echo)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:798) fd: -1 arg_word: {(2)} ) ] ) terminator: (Token id:Id.Op_Semi val:';' span_id:800) ) (command.Sentence child: (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:802) ) terminator: (Token id:Id.Op_Semi val:';' span_id:803) ) ] ) ] ) (C {(stop)}) ] spids: [747 776] ) (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {($ Id.VSub_DollarName '$ret')} {(-eq)} {(3)} {(-o)} {($ Id.VSub_DollarName '$ret')} {(-eq)} {(131)} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:830) ) ] action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(DQ ($ Id.VSub_DollarName '$start'))} {(Id.Lit_RBracket ']')} ) terminator: (Token id:Id.Op_Semi val:';' span_id:849) ) ] action: [ (command.AndOr ops: [Id.Op_DPipe] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:start) op: assign_op.Equal rhs: { (command_sub left_token: (Token id: Id.Left_Backtick val: '`' span_id: 855 ) command_list: (command.CommandList children: [(C {(now)})] ) ) } spids: [854] ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Exit val:exit span_id:863) arg_word: {(1)} ) ] ) (command.Simple words: [{(echo)}] redirects: [ (redir.Redir op: (Token id:Id.Redir_GreatAnd val:'>&' span_id:870) fd: -1 arg_word: {(2)} ) ] ) (command.ControlFlow token: (Token id:Id.ControlFlow_Continue val:continue span_id:874) ) ] spids: [838 851] ) ] ) (C {(lap)} {(DQ ($ Id.VSub_DollarName '$laptime'))} {(DQ (display))}) ] spids: [811 832] ) ] else_action: [ (command.AndOr ops: [Id.Op_DAmp] children: [ (C {(Id.Lit_LBracket '[')} {(Id.KW_Bang '!')} {(DQ ($ Id.VSub_DollarName '$start'))} {(Id.Lit_RBracket ']')} ) (command.ControlFlow token: (Token id:Id.ControlFlow_Continue val:continue span_id:909) ) ] ) (C {(total)}) (C {(lap)} {(DQ ($ Id.VSub_DollarName '$laptime'))}) ] ) ] ) ) ] )