谁会设置BLOCKSIZE

sh/bash/dash/ksh/zsh等Shell脚本
回复
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

谁会设置BLOCKSIZE

#1

帖子 eexpress » 2007-11-01 9:58

省略 df du 的 -h 参数啊。

BLOCKSIZE=HUMAN
BLOCKSIZE=HUMAN-READABLE
不知道怎么设置。
DF_BLOCK_SIZE
This specifies the default block size for the df command. Similarly, DU_BLOCK_SIZE specifies the default for du and LS_BLOCK_SIZE for ls.
BLOCK_SIZE
This specifies the default block size for all three commands, if the above command-specific environment variables are not set.
BLOCKSIZE
This specifies the default block size for all values that are normally printed as blocks, if neither BLOCK_SIZE nor the above command-specific environment variables are set. Unlike the other environment variables, BLOCKSIZE does not affect values that are normally printed as byte counts, e.g., the file sizes contained in ls -l output.
POSIXLY_CORRECT
If neither command_BLOCK_SIZE, nor BLOCK_SIZE, nor BLOCKSIZE is set, but this variable is set, the block size defaults to 512.
变量
变量 POSIXLY_CORRECT 确定计数单位的选择。如果没有设置此变量并且环境变量 BLOCKSIZE 的值 以
HUMAN 为 前 缀,那么,除了 -k 或 -m 选项优先生效的情况,计数单位的行为同于 -h 选项。变量
LANG、LC_ALL、LC_CTYPE 和 LC_MESSAGES 的意义和字面上一样。
● 鸣学
头像
bones7456
帖子: 8495
注册时间: 2006-04-12 20:05
来自: 杭州
联系:

#2

帖子 bones7456 » 2007-11-01 13:05

这是环境变量吗?
关注我的blog: ε==3
悬非
帖子: 19
注册时间: 2007-07-27 22:16
联系:

#3

帖子 悬非 » 2007-11-02 0:00

ee 你都来提问拉!
呵呵就算我知道也不怎么敢随便答阿!


呵呵 说笑拉 你要的效果我还不是很明白:)呵呵可能我的理解能力这个时间段还没修复好 呵呵
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#4

帖子 eexpress » 2007-11-02 14:20

我经常有问题的啊。不会就问啊。你知道赶紧说哦。别害我每次df带一个-h哦。 :lol:
● 鸣学
悬非
帖子: 19
注册时间: 2007-07-27 22:16
联系:

#5

帖子 悬非 » 2007-11-02 20:29

我个人觉得这不关系统的事,只是他们都默认遵守那种规则 如果你偏要改的话 我觉得要每个工具改原代码再从新编译了哦
my blog http://xuanfei.cublog.cn
有空过来骂我几句
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#6

帖子 eexpress » 2007-11-02 21:16

@@啊。man里面说明了。就是遵循这3个环境变量的。
● 鸣学
头像
bones7456
帖子: 8495
注册时间: 2006-04-12 20:05
来自: 杭州
联系:

#7

帖子 bones7456 » 2007-11-03 14:34

试了,似乎和man里说的不一样...
关注我的blog: ε==3
头像
roylez
帖子: 1928
注册时间: 2005-10-04 10:59
来自: 上海

#8

帖子 roylez » 2007-11-03 22:48

eexpress 写了:我经常有问题的啊。不会就问啊。你知道赶紧说哦。别害我每次df带一个-h哦。 :lol:
alias 一下不行吗?
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

#9

帖子 eexpress » 2007-11-03 23:10

哇哇。天。晕死。你竟然出这主意。有时候,研究下啊。
● 鸣学
头像
roylez
帖子: 1928
注册时间: 2005-10-04 10:59
来自: 上海

#10

帖子 roylez » 2007-11-03 23:52

我研究做烦了……
回复