(command.CommandList children: [ (C {<.>} {<'../1/library.sh'>}) (command.ShFunction name: askvalue body: (BraceGroup children: [ (C {<echon>} {(DQ ($ Id.VSub_Number '$1') <' ['> ($ Id.VSub_Number '$2') <'] : '>)}) (C {<read>} {<answer>}) (command.If arms: [ (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} { (braced_var_sub token: <Id.VSub_Name answer> suffix_op: (suffix_op.Unary tok: <Id.VTest_ColonEquals ':='> arg_word: {($ Id.VSub_Number '$2')} ) ) } {<-gt>} {($ Id.VSub_Number '$3')} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Sentence child: (C {<echo>} { (DQ ($ Id.VSub_Number '$0') <': '> ($ Id.VSub_Number '$1') <' '> ($ Id.VSub_DollarName '$answer') <' is invalid'> ) } ) terminator: <Id.Op_Semi _> ) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<0>} ) ] spids: [56 74] ) (if_arm cond: (condition.Shell commands: [ (command.Sentence child: (C {<Id.Lit_LBracket '['>} { (DQ (word_part.ArithSub anode: (arith_expr.Binary op_id: Id.Arith_Minus left: { (command_sub left_token: <Id.Left_DollarParen '$('> child: (command.Pipeline children: [ (C {<echo>} {($ Id.VSub_DollarName '$answer')}) (C {<wc>} {<-c>}) ] negated: F ) ) } right: {<Id.Lit_Digits 1>} ) ) ) } {<-lt>} {($ Id.VSub_Number '$4')} {<Id.Lit_RBracket ']'>} ) terminator: <Id.Op_Semi _> ) ] ) action: [ (command.Sentence child: (C {<echo>} { (DQ ($ Id.VSub_Number '$0') <': '> ($ Id.VSub_Number '$1') <' '> ($ Id.VSub_DollarName '$answer') <' is too short: please specify '> ($ Id.VSub_Number '$4') <' digits'> ) } ) terminator: <Id.Op_Semi _> ) (command.ControlFlow token: <Id.ControlFlow_Exit exit> arg_word: {<0>} ) ] spids: [94 129] ) ] ) (C {<eval>} {($ Id.VSub_Number '$1') <Id.Lit_Equals '='> ($ Id.VSub_DollarName '$answer')}) ] ) ) (C {<eval>} { (command_sub left_token: <Id.Left_DollarParen '$('> child: (C {<date>} {(DQ <'+nyear=%Y nmon=%m nday=%d nhr=%H nmin=%M'>)}) ) } ) (C {<askvalue>} {<year>} {($ Id.VSub_DollarName '$nyear')} {<3000>} {<4>}) (C {<askvalue>} {<month>} {($ Id.VSub_DollarName '$nmon')} {<12>} {<2>}) (C {<askvalue>} {<day>} {($ Id.VSub_DollarName '$nday')} {<31>} {<2>}) (C {<askvalue>} {<hour>} {($ Id.VSub_DollarName '$nhr')} {<24>} {<2>}) (C {<askvalue>} {<minute>} {($ Id.VSub_DollarName '$nmin')} {<59>} {<2>}) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:squished) op: assign_op.Equal rhs: { (DQ ($ Id.VSub_DollarName '$month') ($ Id.VSub_DollarName '$day') ($ Id.VSub_DollarName '$hour') ($ Id.VSub_DollarName '$minute') ($ Id.VSub_DollarName '$year') ) } spids: [235] ) ] ) (C {<echo>} { (DQ <'Setting date to '> ($ Id.VSub_DollarName '$squished') <'. You might need to enter your sudo password:'> ) } ) (C {<sudo>} {<date>} {($ Id.VSub_DollarName '$squished')}) (command.ControlFlow token:<Id.ControlFlow_Exit exit> arg_word:{<0>}) ] )