Dear Andreas,
I tried using @DATE +format@ in my fax header (~/.faxheader), but always got the default 'date' output instead.
It appears that the escaping of a plus sign in /usr/bin/faxspool, in conjunction with GNU sed, might be causing this.
My ~/.faxheader looks like this:
@DATE +%m/%d %Y %R@ @ID@ @N@ (@U@) -> @D@ (@T@) PAGE @P@/@M@
Expected FDATE variable contents (see below) would be something like:
05/17 2021 20:54
Instead I got an empty FDATE variable, and hence, the default output of the 'date' command instead; something like:
mån 17 maj 2021 20:57:40 CEST
Suggested change (unified diff):
--- /usr/bin/faxspool 2018-10-06 22:17:07.000000000 +0200
+++ ./faxspool.NEW 2021-05-17 20:48:40.110235800 +0200
@@ -938,7 +938,7 @@
if [ -n "$FAX_HEADER" ]
then
# flexible DATE format
- FDATE=`sed -n -e '\!@DATE \+[0-9a-zA-Z: \./%\-]*@!s!.*@DATE \(\+[0-9a-zA-Z: \./%\-]*\)@.*!\1!p' $FAX_HEADER`
+ FDATE=`sed -n -e '\!@DATE +[0-9a-zA-Z: \./%\-]*@!s!.*@DATE \(\+[0-9a-zA-Z: \./%\-]*\)@.*!\1!p' $FAX_HEADER`
if [ -n "$FDATE" ] ; then
DATE_OUT=`date "$FDATE"`
else
Some searching yielded this:
https://stackoverflow.com/a/63940155
Might this be the explanation?
And, would the removal of the escaping cause problems for those not using GNU sed?
Many thanks in advance!
Best regards
Björn