ITEM: AA6871L
date command returns blanks instead of padded 0s
Question:
The date command returns blanks instead of padded 0s. How can
I change this?
Response:
As far as just simple presentation goes you could just
alias the date command with:
>alias date='date "+%a %b %d %r %Y $1"'
But, this will not work because you want to use different shells.
You think there is a way to do this with changing the LC_TIME
variable dealing with the locale.
I tested this and it works:
1. cd /usr/lib/nls/loc
cp En_US.IBM-850.src gwm.src
2. Edit the newly created locale source file to change the locale
variables to the desired values:
vi gwm.src
change the %e to %d in
d_t_fmt "%a %b %e %H:%M:%S %Z %Y"
3. Compile the locale definition source file:
localedef -f IBM-850 -i gwm.src gwm
4. LOCPATH=/usr/lib/nls/loc; export LOCPATH
Note: All setuid and setgid programs will ignore the LOCPATH
environment variable.
5. Set the corresponding environment variable or variables:
LC_TIME=gwm; export LC_TIME
This solved your problem.
Support Line: date command returns blanks instead of padded 0s ITEM: AA6871L
Dated: August 1994 Category: N/A
This HTML file was generated 99/06/24~13:30:32
Comments or suggestions?
Contact us