[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] Changing A Defined String
From: |
Robert Thorsby |
Subject: |
[groff] Changing A Defined String |
Date: |
Thu, 25 Jan 2018 15:03:24 +1100 |
Temperatures here in AU have been in the range 35-45 for the past week
and are forecast to be the same for the next week. So with no
inclination towards serious work I have turned my attention to
rewriting my letterhead shell script, as one does.
My letters carry the date in full -- Thursday, 25 January 2018 -- which
is placed into the preamble of the groff file via my shell script:
date --date="..." "+.ds DATE*FULL %A, %-d %B %Y" >> draftletter.gr
But occasionally I also want to use the date in a ``shorter'' version
that depends on the ``full'' version. I appreciate that I can simply
create two definitions, but once defined they would be independent of
each other.
.ds DATE*FULL Thursday, 25 January 2018\" from the shell script
.ds DATE*SHORT 25 January 2018\" from the shell script
[each can be subsequently edited without reference to the other]
What I'm after is something like:
.ds DATE*FULL Thursday, 25 January 2018\" from the shell script
.ds DATE*SHORT \*[DATE*FULL]\" static entry in groff
file
DATE*SHORT="$(sed 's/.*, //' <<< "$DATE*FULL")" static entry in groff
file
Can anyone assist with proper groff request(s) to replace the bashism
so that any amendment to DATE*FULL is carried through automagically to
DATE*SHORT? I don't use any macro package.
TIA,
Robert
- [groff] Changing A Defined String,
Robert Thorsby <=
- Re: [groff] Changing A Defined String, Ralph Corderoy, 2018/01/25
- Re: [groff] Changing A Defined String, Steffen Nurpmeso, 2018/01/25
- Re: [groff] Changing A Defined String, Tadziu Hoffmann, 2018/01/25
- Re: [groff] Changing A Defined String, Robert Thorsby, 2018/01/25
- Re: [groff] Changing A Defined String, Ralph Corderoy, 2018/01/25
- Re: [groff] Changing A Defined String, Robert Thorsby, 2018/01/25
- Re: [groff] Changing A Defined String, Tadziu Hoffmann, 2018/01/26
- Re: [groff] Changing A Defined String, Ralph Corderoy, 2018/01/27
- Re: [groff] Changing A Defined String, Tadziu Hoffmann, 2018/01/27
- Re: [groff] Changing A Defined String, Tadziu Hoffmann, 2018/01/27