Bug 56196

Summary: /etc/profile.d/lang.sh should set TIME_STYLE also
Product: [Retired] Red Hat Raw Hide Reporter: Enrico Scholz <rh-bugzilla>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED CURRENTRELEASE QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: rvokal
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-02-05 00:49:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Enrico Scholz 2001-11-13 20:17:13 UTC
Description of Problem:

Recent fileutils are honoring the TIME_STYLE env-variable which is assumed
to be `posix-iso' by default. Compared with older versions (defaulted to
`locale'), this is an unexpected behavior:

$ TIME_STYLE=locale /bin/ls -l X; unset TIME_STYLE && /bin/ls -l X
-rw-rw-r--    1 ensc     ensc            0 Nov 13 21:13 X
-rw-rw-r--    1 ensc     ensc            0 11-13 21:13 X


Therefore, I suggest to set this variable somewhere in the initscripts (and
make it userconfigurable e.g. by locale_config). /etc/profile.d/lang.sh
seems to be a reasonable place.


Additional Information:

$ rpm -q initscripts fileutils
initscripts-6.40.2-1
fileutils-4.1.1-1

Comment 1 Richard Lloyd 2002-07-14 15:33:03 UTC
Just a note that this hasn't been fixed in the latest Red Hat Beta
(Limbo - 7.3.92) and has the potential to break any shell script that
parses the output from "ls -l", particularly since if a file is >6 months
old, the "ls -l" output displays the date in "YYYY-MM-DD" format, reducing
the number of space-separated date fields from 2 to 1 of course.

As the reporter says, you can set TIME_STYLE="locale" (or, if you must,
supply "--time-style=locale"), but you've got to wonder why the GNU fileutils
folks actually made posix-iso the default, rather than locale (the latter
of which has been the default pretty well since UNIX began). Maybe it's
the fileutils team that need to fix this, rather than it just being a
Red Hat fix ? I bet a lot of other distros get bitten by this when they
upgrade their fileutils packages...

Comment 2 Miloslav Trmac 2004-02-05 00:49:07 UTC
coreutils-5.0.24 use the "locale" format unless POSIXLY_CORRECT is set,
so this is not needed anymore.