From 4a04dc4e7e882b6b4fd19059e521e261a6703f89 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Paul=20H=C3=A4nsch?= Date: Mon, 26 Jul 2021 15:08:44 +0200 Subject: [PATCH] portability GNU `date` / Busybox `date` --- file.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/file.sh b/file.sh index 04a8ef6..6f956df 100755 --- a/file.sh +++ b/file.sh @@ -58,8 +58,7 @@ FILE(){ file_size="$(stat -Lc %s "$file")" file_date="$(stat -Lc %Y "$file")" - http_date="$(date -uRd @$file_date)" - http_date="${http_date%+0000}GMT" + http_date="$(date -ud "@$file_date" +"%a, %d %b %Y %T GMT")" cachedate="$( # Parse the allowable date formats from Section 3.3.1 of # https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html -- 2.39.2