(command.CommandList children: [ (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:file) op:Equal rhs:{(DQ ($ VSub_Number '$1'))})] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:epoch) op:Equal rhs:{(DQ ($ VSub_Number '$2'))})] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.AndOr ops: [Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(KW_Bang '!')} {(-f)} {(DQ ($ VSub_DollarName '$file'))} {(Lit_RBracket ']')} ) (C {(Lit_LBracket '[')} {($ VSub_Pound '$#')} {(-ne)} {(1)} {(-a)} {($ VSub_Pound '$#')} {(-ne)} {(2)} {(Lit_RBracket ']')} ) ] ) terminator: <Op_Semi ';'> ) ] action: [ (command.Simple words: [ {(echo)} { (DQ ('Usage: ') (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [(C {(basename)} {($ VSub_Number '$0')})] ) ) (' file [epoch]') ) } ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(KW_Bang '!')} {(DQ ($ VSub_DollarName '$epoch'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.AndOr ops: [Op_DPipe] children: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:epoch) op: Equal rhs: { (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [ (C {(date)} {(--reference) (Lit_Equals '=') (DQ ($ VSub_DollarName '$file'))} {(Lit_Other '+') (Lit_Other '%') (s.) (Lit_Other '%') (N)} ) ] ) ) } ) ] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) ] ) ] else_action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_DollarName '$epoch'))}) (C {(grep)} {(-Eq)} {(DQ ('^[') (Lit_Other '\\') ('+-]'))}) ] negated: F ) terminator: <Op_Semi ';'> ) ] action: [ (command.Simple words: [{(echo)} {(DQ ('Epochs with leading +/- are ambiguous with editor options'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (command.Simple words: [ {(date)} {(--date) (Lit_Equals '=') (DQ ('1970-01-01 UTC ') ($ VSub_DollarName '$epoch') (' seconds')) } ] redirects: [ (redir.Redir op: <Redir_Great '>'> fd: 16777215 arg_word: {(/dev/null)} ) (redir.Redir op: <Redir_GreatAnd '2>&'> fd: 2 arg_word: {(1)} ) ] ) ] negated: T ) terminator: <Op_Semi ';'> ) ] action: [ (command.Simple words: [ {(echo)} {(DQ ('Invalid epoch specified [') ($ VSub_DollarName '$epoch') (']'))} ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) (command.ControlFlow token:<ControlFlow_Exit exit> arg_word:{(1)}) ] ) ] ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(echo)} {(DQ ($ VSub_DollarName '$epoch'))}) (C {(grep)} {(-Fq)} {(DQ (.))}) ] negated: F ) terminator: <Op_Semi ';'> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:seconds) op: Equal rhs: { (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} {($ VSub_DollarName '$epoch')}) (C {(cut)} {(-d.)} {(-f1)}) ] negated: F ) ] ) ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (command.Pipeline children: [ (C {(echo)} {($ VSub_DollarName '$epoch')}) (C {(grep)} {(-Eq)} {(DQ (Lit_Other '\\') ('.0+') (Lit_Other '$'))}) ] negated: F ) terminator: <Op_Semi ';'> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:epoch) op: Equal rhs: {($ VSub_DollarName '$seconds')} ) ] ) ] ) ] else_action: [ (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:checkns) op:Equal rhs:{(DQ (true))})] ) ] ) ] ) ] ) (C { (braced_var_sub token: <VSub_Name EDITOR> suffix_op: (suffix_op.Unary op_id:VTest_ColonHyphen arg_word:{(vim)}) ) } {(DQ ($ VSub_DollarName '$file'))} ) (command.AndOr ops: [Op_DAmp Op_DPipe] children: [ (C {(Lit_LBracket '[')} {(KW_Bang '!')} {(DQ ($ VSub_DollarName '$seconds'))} {(Lit_RBracket ']')} ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:err) op:Equal rhs:{(DQ (/dev/tty))})] ) (command.ShAssignment pairs: [(assign_pair lhs:(sh_lhs_expr.Name name:err) op:Equal rhs:{(DQ (/dev/null))})] ) ] ) (command.Simple words: [ {(touch)} {(DQ ($ VSub_DollarName '$file'))} {(--date) (Lit_Equals '=') (DQ ('1970-01-01 UTC ') ($ VSub_DollarName '$epoch') (' seconds'))} ] redirects: [(redir.Redir op:<Redir_Great '2>'> fd:2 arg_word:{($ VSub_DollarName '$err')})] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {($ VSub_QMark '$?')} {(-ne)} {(0)} {(-a)} {(DQ ($ VSub_DollarName '$seconds'))} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.AndOr ops: [Op_DAmp] children: [ (C {(touch)} {(DQ ($ VSub_DollarName '$file'))} {(--date) (Lit_Equals '=') (DQ ('1970-01-01 UTC ') ($ VSub_DollarName '$seconds') (' seconds')) } ) (command.Simple words: [{(echo)} {(DQ ('Warning: sub second portion of timestamp ignored'))}] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) ] ) ] ) ] else_action: [ (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {(DQ ($ VSub_DollarName '$checkns'))} {(Lit_RBracket ']')}) terminator: <Op_Semi ';'> ) ] action: [ (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:new_ts) op: Equal rhs: { (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [ (C {(date)} {(--reference) (Lit_Equals '=') (DQ ($ VSub_DollarName '$file'))} {(Lit_Other '+') (Lit_Other '%') (s.) (Lit_Other '%') (N)} ) ] ) ) } ) ] ) (command.ShAssignment pairs: [ (assign_pair lhs: (sh_lhs_expr.Name name:diff) op: Equal rhs: { (command_sub left_token: <Left_Backtick '`'> command_list: (command.CommandList children: [ (command.Pipeline children: [ (C {(echo)} { (DQ ('((') ($ VSub_DollarName '$epoch') (-) ($ VSub_DollarName '$new_ts') (')*10^9)/1') ) } ) (C {(bc)}) ] negated: F ) ] ) ) } ) ] ) (command.If arms: [ (if_arm cond: [ (command.Sentence child: (C {(Lit_LBracket '[')} {($ VSub_DollarName '$diff')} {(-ne)} {(0)} {(Lit_RBracket ']')} ) terminator: <Op_Semi ';'> ) ] action: [ (command.Simple words: [ {(echo)} {(DQ ('Warning: timestamp set ') (${ VSub_Name diff) ('ns backwards'))} ] redirects: [(redir.Redir op:<Redir_GreatAnd '>&'> fd:16777215 arg_word:{(2)})] ) ] ) ] ) ] ) ] ) ] ) ] )