[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [nmh-workers] Ordinal Indicators.
From: |
Ralph Corderoy |
Subject: |
Re: [nmh-workers] Ordinal Indicators. |
Date: |
Mon, 08 Jul 2019 13:08:49 +0100 |
Hi kre,
> D=$(date +%d)
> case "$D" in
> [023]1) ORD=st;;
> [02]2) ORD=nd;;
> [02]3) ORD=rd;;
> *) ORD=th;;
> esac
> case "$D" in
> 0*) SP=;;
> *) SP=' ';;
> esac
I ended up with
$ cat ~/bin/ordsuff
#! /bin/sed -rf
# Append an ordinal indicator to the number on each line.
s/1$/&st/
s/2$/&nd/
s/3$/&rd/
s/[4-9]$/&th/
s/.0$/&th/
/1(1st|2nd|3rd)$/s/..$/th/
$
> ps: this is not really an nmh-workers issue!
This is true. To correct that, I note mh-format(5) too has no function
to produce the ordinal suffix. :-)
--
Cheers, Ralph.
- Re: [nmh-workers] Formatting HTML to Text: netrik., (continued)
- Re: [nmh-workers] Formatting HTML to Text: netrik., Ralph Corderoy, 2019/07/07
- Re: [nmh-workers] Formatting HTML to Text: netrik., Ralph Corderoy, 2019/07/07
- Re: [nmh-workers] Formatting HTML to Text: netrik., Ronald F. Guilmette, 2019/07/07
- Re: [nmh-workers] Formatting HTML to Text: netrik., Robert Elz, 2019/07/07
- Re: [nmh-workers] Formatting HTML to Text: netrik., David Levine, 2019/07/07
- Re: [nmh-workers] Formatting HTML to Text: netrik., Robert Elz, 2019/07/07
- Re: [nmh-workers] Formatting HTML to Text: netrik., Ronald F. Guilmette, 2019/07/07
- Re: [nmh-workers] Formatting HTML to Text: netrik., Robert Elz, 2019/07/07
- Re: [nmh-workers] Ordinal Indicators., Ralph Corderoy, 2019/07/08
- Re: [nmh-workers] Ordinal Indicators., Robert Elz, 2019/07/08
- Re: [nmh-workers] Ordinal Indicators.,
Ralph Corderoy <=
- Re: [nmh-workers] Ordinal Indicators., Ken Hornstein, 2019/07/08
- Re: [nmh-workers] Ordinal Indicators., Ralph Corderoy, 2019/07/08
- Re: [nmh-workers] Ordinal Indicators., Ken Hornstein, 2019/07/08
- Re: [nmh-workers] Ordinal Indicators., Ralph Corderoy, 2019/07/08
- Re: [nmh-workers] Ordinal Indicators., Robert Elz, 2019/07/08
- Re: [nmh-workers] Ordinal Indicators., Ken Hornstein, 2019/07/08
- Re: [nmh-workers] Ordinal Indicators., Ralph Corderoy, 2019/07/08
- Re: [nmh-workers] Ordinal Indicators., Ralph Corderoy, 2019/07/08
- Re: [nmh-workers] Ordinal Indicators., Ken Hornstein, 2019/07/08
- Re: [nmh-workers] Ordinal Indicators., Valdis Klētnieks, 2019/07/08