[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Should "df --portability" allow thousands separators?
From: |
Peter D. |
Subject: |
Re: Should "df --portability" allow thousands separators? |
Date: |
Mon, 26 Feb 2007 17:55:05 +1100 |
User-agent: |
KMail/1.9.4 |
On Monday 26 February 2007 15:11, Paul Eggert wrote:
> "Peter D." <address@hidden> writes:
> > I have an environment variable set that triggers thousands separators.
> > It can be overridden with an extra command line option, but I suspect
> > that a "-P" should be sufficient.
>
> Can you please be more specific? Which environment variable is that?
Sure. This line in /etc/bashrc sets thousands separators in ls, du and df.
export BLOCK_SIZE=\'1
The escaped apostrophe does the magic.
> What does the output look like, when you set that variable?
Here are a couple of examples with the environment variable BLOCK_SIZE set
as above...
address@hidden ~
->df .
Filesystem 1B-blocks Used Available Use% Mounted on
/dev/hdc7 4,120,768,512 1,770,029,056 2,350,739,456 43% /home
address@hidden ~
->df -P .
Filesystem 1-blocks Used Available Capacity Mounted on
/dev/hdc7 4,120,768,512 1,770,029,056 2,350,739,456
43% /home
address@hidden ~
->df -P --block-size=1 .
Filesystem 1-blocks Used Available Capacity Mounted on
/dev/hdc7 4120768512 1770029056 2350739456 43% /home
address@hidden ~
->df -P --block-size=\'1 .
Filesystem 1-blocks Used Available Capacity Mounted on
/dev/hdc7 4,120,768,512 1,770,029,056 2,350,739,456
43% /home
Sorry about the line wrap, also my bash prompt is a multicolored two line
thing, but I am sure you can make sense of if.
> Also,
> what locale are you using (what is the output of the 'locale'
> command)?
address@hidden ~
->locale
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=en_AU.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE=en_US.UTF-8
LC_MONETARY=en_AU.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_AU.UTF-8
LC_NAME=en_AU.UTF-8
LC_ADDRESS=en_AU.UTF-8
LC_TELEPHONE=en_AU.UTF-8
LC_MEASUREMENT=en_AU.UTF-8
LC_IDENTIFICATION=en_AU.UTF-8
LC_ALL=
> It could well be that 'df' is conforming to POSIX, but nonetheless
> could be improved.
I am sufficiently ignorant of POSIX that df could be in completely compliant
and I would not know.
Unfortunately there are cases where code (wrongly?) calls "df -P" and fails
because of the commas. Here is a solved example,
<http://qa.mandriva.com/show_bug.cgi?id=28489>.
Maybe code that calls "df --portability" and fails because of commas is just
wrong. I don't know.
--
sig goes here...
Peter D.
- Should "df --portability" allow thousands separators?, Peter D., 2007/02/24
- Re: Should "df --portability" allow thousands separators?, Paul Eggert, 2007/02/25
- Re: Should "df --portability" allow thousands separators?,
Peter D. <=
- Re: Should "df --portability" allow thousands separators?, Paul Eggert, 2007/02/26
- Re: Should "df --portability" allow thousands separators?, Peter D., 2007/02/26
- Re: Should "df --portability" allow thousands separators?, Jim Meyering, 2007/02/26
- Re: Should "df --portability" allow thousands separators?, Peter D., 2007/02/26
- Re: Should "df --portability" allow thousands separators?, Paul Eggert, 2007/02/27
- Re: Should "df --portability" allow thousands separators?, Jim Meyering, 2007/02/27
- Re: Should "df --portability" allow thousands separators?, Peter D., 2007/02/28
- Re: Should "df --portability" allow thousands separators?, Paul Eggert, 2007/02/28