2 Nov 2011 09:45
Re: humanize_number(3) for dd(1) summary?
Jean-Yves Migeon <jeanyves.migeon <at> free.fr>
2011-11-02 08:45:49 GMT
2011-11-02 08:45:49 GMT
On 04.12.2010 19:05, Jean-Yves Migeon wrote: > On 04.12.2010 17:54, Matt Thomas wrote: >> I use dd to test performance and 2 digits of data is not neough. >> I actually like the current output. I also support the idea if >> you want humanized numbers, a conv= option would be best. > > I'll do as Christos suggested: leave the output as is, but implement a > msgfmt parameter where you can either: > - pass options: > 'msgfmt=human' (human readable output) > 'msgfmt=quiet' (silent mode -- if you don't care about output) > - pass a string format, similar to date(1) with strftime(3): > msgfmt="%i records in\n%B bytes\nfoo %bar baz\n" > > Default output will remain the same. Those that want to use dd(1) for > specific stuff like benchmarks or testing could use the msgfmt string to > tailor output to their liking. Wow, I forgot I wrote this a long time ago and kept it sleeping in part of my tree *sigh* The attached patch extends dd(1) in a way that permits specifying either: - a msgfmt, with "human", "quiet", "posix" currently in place - an arbitrary format, when passed as msgfmt=... to command line by user. Of course the default behavior of dd(1) remains POSIX. It's only when the user passes msgfmt as argument that dd(1) will modify its summary() message. Examples:(Continue reading)
RSS Feed