(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:file) op: Equal rhs: {(DQ ($ VSub_Number "$1"))} spids: [75] ) ] spids: [75] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:epoch) op: Equal rhs: {(DQ ($ VSub_Number "$2"))} spids: [80] ) ] spids: [80] ) (If arms: [ (if_arm cond: [ (Sentence child: (AndOr children: [ (C {(Lit_Other "[")} {(KW_Bang "!")} {(-f)} {(DQ ($ VSub_Name "$file"))} {(Lit_Other "]")} ) (C {(Lit_Other "[")} {($ VSub_Pound "$#")} {(-ne)} {(1)} {(-a)} {($ VSub_Pound "$#")} {(-ne)} {(2)} {(Lit_Other "]")} ) ] op_id: Op_DPipe ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} { (DQ ("Usage: ") (CommandSubPart command_list: (CommandList children:[(C {(basename)} {($ VSub_Number "$0")})]) left_token: <Left_Backtick "`"> spids: [128 132] ) (" file [epoch]") ) } ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[136])] ) (C {(exit)} {(1)}) ] spids: [-1 121] ) ] spids: [-1 144] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(KW_Bang "!")} {(DQ ($ VSub_Name "$epoch"))} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (AndOr children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:epoch) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(date)} {(--reference) (Lit_Other "=") (DQ ($ VSub_Name "$file"))} {(Lit_Other "+") (Lit_Other "%") (s.) (Lit_Other "%") (N)} ) ] ) left_token: <Left_Backtick "`"> spids: [164 178] ) } spids: [163] ) ] spids: [163] ) (C {(exit)} {(1)}) ] op_id: Op_DPipe ) ] spids: [-1 160] ) ] else_action: [ (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(echo)} {(DQ ($ VSub_Name "$epoch"))}) (C {(grep)} {(-Eq)} {(DQ ("^[") (EscapedLiteralPart token:<Lit_EscapedChar "\\+">) ("-]"))} ) ] negated: False ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ("Epochs with leading +/- are ambiguous with editor options"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[219])] ) (C {(exit)} {(1)}) ] spids: [-1 210] ) ] spids: [-1 228] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (SimpleCommand words: [ {(date)} {(--date) (Lit_Other "=") (DQ ("1970-01-01 UTC ") ($ VSub_Name "$epoch") (" seconds")) } ] redirects: [ (Redir op_id: Redir_Great fd: -1 arg_word: {(/dev/null)} spids: [245] ) (Redir op_id: Redir_GreatAnd fd: 2 arg_word: {(1)} spids: [248] ) ] ) ] negated: True ) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [{(echo)} {(DQ ("Invalid epoch specified [") ($ VSub_Name "$epoch") ("]"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[263])] ) (C {(exit)} {(1)}) ] spids: [-1 252] ) ] spids: [-1 272] ) ] spids: [186 274] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [(C {(echo)} {(DQ ($ VSub_Name "$epoch"))}) (C {(grep)} {(-Fq)} {(DQ (.))})] negated: False ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:seconds) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} {($ VSub_Name "$epoch")}) (C {(cut)} {(-d.)} {(-f1)}) ] negated: False ) ] ) left_token: <Left_Backtick "`"> spids: [303 315] ) } spids: [302] ) ] spids: [302] ) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children: [ (C {(echo)} {($ VSub_Name "$epoch")}) (C {(grep)} {(-Eq)} { (DQ (EscapedLiteralPart token:<Lit_EscapedChar "\\.">) ("0+") (Lit_Other "$") ) } ) ] negated: False ) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:epoch) op: Equal rhs: {($ VSub_Name "$seconds")} spids: [343] ) ] spids: [343] ) ] spids: [-1 337] ) ] else_action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:checkns) op: Equal rhs: {(DQ (true))} spids: [353] ) ] spids: [353] ) ] spids: [350 362] ) ] spids: [-1 296] ) ] spids: [-1 364] ) (C { (BracedVarSub token: <VSub_Name EDITOR> suffix_op: (StringUnary op_id:VTest_ColonHyphen arg_word:{(vim)}) spids: [366 370] ) } {(DQ ($ VSub_Name "$file"))} ) (AndOr children: [ (C {(Lit_Other "[")} {(KW_Bang "!")} {(DQ ($ VSub_Name "$seconds"))} {(Lit_Other "]")}) (AndOr children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:err) op:Equal rhs:{(DQ (/dev/tty))} spids:[388])] spids: [388] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:err) op: Equal rhs: {(DQ (/dev/null))} spids: [395] ) ] spids: [395] ) ] op_id: Op_DPipe ) ] op_id: Op_DAmp ) (SimpleCommand words: [ {(touch)} {(DQ ($ VSub_Name "$file"))} {(--date) (Lit_Other "=") (DQ ("1970-01-01 UTC ") ($ VSub_Name "$epoch") (" seconds"))} ] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{($ VSub_Name "$err")} spids:[414])] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {($ VSub_QMark "$?")} {(-ne)} {(0)} {(-a)} {(DQ ($ VSub_Name "$seconds"))} {(Lit_Other "]")} ) terminator: <Op_Semi ";"> ) ] action: [ (AndOr children: [ (C {(touch)} {(DQ ($ VSub_Name "$file"))} {(--date) (Lit_Other "=") (DQ ("1970-01-01 UTC ") ($ VSub_Name "$seconds") (" seconds")) } ) (SimpleCommand words: [{(echo)} {(DQ ("Warning: sub second portion of timestamp ignored"))}] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[465])] ) ] op_id: Op_DAmp ) ] spids: [-1 436] ) ] else_action: [ (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {(DQ ($ VSub_Name "$checkns"))} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:new_ts) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (C {(date)} {(--reference) (Lit_Other "=") (DQ ($ VSub_Name "$file"))} {(Lit_Other "+") (Lit_Other "%") (s.) (Lit_Other "%") (N)} ) ] ) left_token: <Left_Backtick "`"> spids: [486 500] ) } spids: [485] ) ] spids: [485] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:diff) op: Equal rhs: { (CommandSubPart command_list: (CommandList children: [ (Pipeline children: [ (C {(echo)} { (DQ ("((") ($ VSub_Name "$epoch") (-) ($ VSub_Name "$new_ts") (")*10^9)/1") ) } ) (C {(bc)}) ] negated: False ) ] ) left_token: <Left_Backtick "`"> spids: [504 518] ) } spids: [503] ) ] spids: [503] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other "[")} {($ VSub_Name "$diff")} {(-ne)} {(0)} {(Lit_Other "]")}) terminator: <Op_Semi ";"> ) ] action: [ (SimpleCommand words: [ {(echo)} {(DQ ("Warning: timestamp set ") (${ VSub_Name diff) ("ns backwards"))} ] redirects: [(Redir op_id:Redir_GreatAnd fd:-1 arg_word:{(2)} spids:[547])] ) ] spids: [-1 534] ) ] spids: [-1 551] ) ] spids: [-1 482] ) ] spids: [-1 554] ) ] spids: [468 556] ) ] )