tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: humanize_number(3) for dd(1) summary?

On 04.12.2010 14:14, der Mouse wrote:
>> $ dd if=/dev/zero of=/tmp/foo msgfmt=quiet
>> 1+0 records in
>> 1+0 records out
>> $ dd if=/dev/zero of=/tmp/foo msgfmt=human
>> 1+0 records in
>> 1+0 records out
>> 1073741824 bytes (1,0 GB) transferred in 15.701 secs (65 MB/sec)
> Well, I'd be disturbed by a dd that defaulted to 1G blocks.  I'd be
> even more disturbed by a /dev/zero that reached EOF after only 1G.

Pasto (and laziness) issues :(

> (I'd also wonder why the time is printed to millisecond resolution but
> the transfer rate is rounded off to either an integer or two
> significant places, I can't tell which.)

Fair point. For msgfmt=human, I will keep the bytes values, and add
their "humanized" form just after. Anyone can get a quick overview when
seeing xxxx MB/s , and can still work on precise bytes values if he
wants to.

> /~\ The ASCII                           Mouse
> \ / Ribbon Campaign
>  X  Against HTML    
> / \ Email!         7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B
> PS.  :-)  Seriously, this looks to me like a suitable approach.  People
> who don't like the typing involved for msgfmt=human on interactive use
> are invited to create shell aliases, or script in their personal bin
> directories.  Perhaps add a msgfmt=tty-human which tests isatty(2).

Sure; I am not too concerned by "polluting" the conv parameter
namespace, now that another option will get used for this.

(Unless SUS/Open Group think about adding a similar option too, but
"future directions" regarding dd(1) seem to be... in the lowest part of
their task list).

Thanks all for the advices, I will come back shortly with a new proposal.

Jean-Yves Migeon

Home | Main Index | Thread Index | Old Index