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 Dec 4,  1:27pm, jeanyves.migeon%free.fr@localhost (Jean-Yves Migeon) wrote:
-- Subject: Re: humanize_number(3) for dd(1) summary?

| On 04.12.2010 05:46, Christos Zoulas wrote:
| > On Dec 4,  2:14am, jeanyves.migeon%free.fr@localhost (Jean-Yves Migeon) 
wrote:
| > -- Subject: Re: humanize_number(3) for dd(1) summary?
| > 
| > | "conv" is for controlling conversion done by dd(1) between stdin and
| > | stdout no? Is it really clean to use it for controlling stderr output?
| > | 
| > | I can mimic what ls(1), df(1), du(1), ... do and add a "-h" flag to have
| > | a "human readable" summary.
| > 
| > perhaps something else then like msgfmt="...". I don't think that dd is
| > supposed to parse getopt like options.
| 
| Hmm, like it. Something along the line of:
| 
| $ 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)

Sure, ideally you could have a formatting string too, so that you output
only the things you need surrounded with the strings you want:

For example the default format could be:

%I+%i records in\n
%O+%o records out\n
%b bytes transferred in %s secs (%p %u/sec)\n

christos


Home | Main Index | Thread Index | Old Index