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?

> $ 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.
(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.)

/~\ 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).

Home | Main Index | Thread Index | Old Index