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. -- nmh-workers https://lists.nongnu.org/mailman/listinfo/nmh-workers