Created
January 28, 2021 02:15
-
-
Save justanotherdot/8b130ad303b7bec2ff7cc405db3fdbe1 to your computer and use it in GitHub Desktop.
Revisions
-
justanotherdot revised this gist
Jan 28, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ : {d1:=1} : {d2:=2} : {op:?"provide an operator for comparison"} lhs=date -j -f "%F" "$d1" +%s 2>/dev/null rhs=date -j -f "%F" "$d2" +%s 2>/dev/null -
justanotherdot created this gist
Jan 28, 2021 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ : {d1:=1} : {d2:=2} # : {op:?"provide an operator for comparison"} lhs=date -j -f "%F" "$d1" +%s 2>/dev/null rhs=date -j -f "%F" "$d2" +%s 2>/dev/null case $op in "eq") [ lhs -eq rhs ] ;; "ge") [ lhs -ge rhs ] ;; "le") [ lhs -le rhs ] ;; "gt") [ lhs -gt rhs ] ;; "lt") [ lhs -lt rhs ] ;; esac