QQ43@LIVERPOOL.AC.UK (Chris Wooff) (07/30/90)
I'd like hdr_format to include a date in the form ddMMMyy, e.g. 01Aug90. %2N%3M%y almost gives me what I want. However, the above date prints as 1 Aug90. Is there some easy way in which I can force the leading zero? Chris Wooff INTERNET: QQ43@LIVERPOOL.AC.UK JANET: QQ43@UK.AC.LIVERPOOL UUCP: ....!mcvax!ukc!liverpool.ac.uk!qq43
schaefer@CSE.OGI.EDU (Barton E. Schaefer) (07/31/90)
On Jul 30, 12:54pm, Chris Wooff wrote: } Subject: The hdr_format variable } } I'd like hdr_format to include a date in the form ddMMMyy, e.g. 01Aug90. } %2N%3M%y almost gives me what I want. However, the above date prints } as 1 Aug90. Is there some easy way in which I can force the leading zero? No, but you can get a leading rather than trailing space on the %N. The default in mush is to left-justify hdr_format fields. So in a sort of reversal on printf, mush will right-justify if you specify a negative field width. To wit: %-2N%3M%y will produce " 1Aug90" and "27Jul90" instead of "1 Aug90" and "27Jul90". This at least has the right width for the rest of your formatting and looks less ragged. Unfortunately, mush uses atoi() on the field width specifiers as it reads them, so it currently does not recognize leading 0s to specify zero-padding. -- Bart Schaefer schaefer@cse.ogi.edu