bug fix, removed prints in awk

This commit is contained in:
Ämin Baumeler 2025-06-11 10:18:43 +02:00
parent e254463b0e
commit f463b957bd

View File

@ -46,19 +46,15 @@ END {
cmd | getline t cmd | getline t
close(cmd) close(cmd)
t = t + 0 t = t + 0
print "fromnano="t
if (t == 0) { if (t == 0) {
print "ok, DATE-TIME type"
from_type = "DATE-TIME" from_type = "DATE-TIME"
cmd = "date -d \"" from "\" +\"@%s\" | xargs date -u +\"%Y%m%dT%H%M00Z\" -d" cmd = "date -d \"" from "\" +\"@%s\" | xargs date -u +\"%Y%m%dT%H%M00Z\" -d"
} else { } else {
print "ok, DATE type"
from_type = "DATE" from_type = "DATE"
cmd = "date -d \"" from "\" +\"%Y%m%d\""; cmd = "date -d \"" from "\" +\"%Y%m%d\"";
} }
cmd | getline from cmd | getline from
close(cmd) close(cmd)
print "FROM="from
# #
to = to ? to : "now" to = to ? to : "now"
cmd = "date -d \"" to "\" +\"%N\""; cmd = "date -d \"" to "\" +\"%N\"";