Re: [groff] Changing A Defined String

2018-01-25 Thread Robert Thorsby
On 26/01/18 10:47:12, Ralph Corderoy wrote: > the .substring request, combined with good old nested conditionals. Or there's a `.while' IIRC. :-) You most certainly do RC, Ralph. Didn't occur to me that groff had loops, but I had looked up ``for'' just in case. That should make it easier

Re: [groff] Changing A Defined String

2018-01-25 Thread Ralph Corderoy
Ho Robert, > the .substring request, combined with good old nested conditionals. Or there's a `.while' IIRC. :-) -- Cheers, Ralph. https://plus.google.com/+RalphCorderoy

Re: [groff] Changing A Defined String

2018-01-25 Thread Robert Thorsby
On 26/01/18 01:22:39, Tadziu Hoffmann wrote: If you want the following behavior: .ds DATE*FULL The updated short date is \*[DATE*SHORT]. Thank you Ralph and Tadziu, The answer lay in Ralph's suggestion of the .substring request, combined with good old nested conditionals. Since the c

Re: [groff] Changing A Defined String

2018-01-25 Thread Tadziu Hoffmann
If you want the following behavior: .ds DATE*FULL The updated short date is \*[DATE*SHORT]. then I don't think that will be possible, since you can't do any complex processing inside a string invocation. If you are willing to treat the dates as macros instead of strings, like so: .DATE

Re: [groff] Changing A Defined String

2018-01-25 Thread Steffen Nurpmeso
Robert Thorsby wrote: |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. And you have

Re: [groff] Changing A Defined String

2018-01-25 Thread Ralph Corderoy
Hi Robert, > DATE*SHORT="$(sed 's/.*, //' <<< "$DATE*FULL")" My guess is you have to play with .substring, and perhaps .length, to work through the long version until you find the comma. -- Cheers, Ralph. https://plus.google.com/+RalphCorderoy