From 8f9bf300174afa9b29027542ec59892f610c08e4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 31 Dec 2015 11:43:09 -0800 Subject: dd: summarize in --human-readable format too Problem reported by Linda Walsh in: http://bugs.gnu.org/17505 * NEWS: Document this. * doc/coreutils.texi (dd invocation): Use a simpler script. Adjust output example to match new behavior. * src/dd.c (human_size): Remove. All uses changed to use human_readable and ... (human_opts): ... this new constant. (abbreviation_lacks_prefix): New function. (print_xfer_stats): Use it. Output both --si and --human-readable summaries, but only if they have prefixes. * tests/dd/reblock.sh, tests/dd/stats.sh: Test new behavior. --- doc/coreutils.texi | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'doc') diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 64419c769..8eb2a3e1e 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -8835,23 +8835,23 @@ trap '' USR1 # which can be triggered by reception of signals. dd iflag=fullblock if=/dev/zero of=/dev/null count=5000000 bs=1000 & pid=$! -# Output stats every half second -until ! kill -s USR1 $pid 2>/dev/null; do sleep .5; done +# Output stats every second. +while kill -s USR1 $pid 2>/dev/null; do sleep 1; done @end example -The above script will output in the following format +The above script will output in the following format: @example -859+0 records in -859+0 records out -4295000000 bytes (4.3 GB) copied, 0.539934 s, 8.0 GB/s -1000+0 records in -1000+0 records out -5000000000 bytes (5.0 GB) copied, 0.630785 s, 7.9 GB/s +3441325+0 records in +3441325+0 records out +3441325000 bytes (3.4 GB, 3.2 GiB) copied, 1.00036 s, 3.4 GB/s +5000000+0 records in +5000000+0 records out +5000000000 bytes (5.0 GB, 4.7 GiB) copied, 1.44433 s, 3.5 GB/s @end example -Note also the @samp{status=progress} option which periodically updates -the last line of the transfer statistics above. +The @samp{status=progress} option periodically updates the last line +of the transfer statistics above. @vindex POSIXLY_CORRECT On systems lacking the @samp{INFO} signal @command{dd} responds to the -- cgit v1.2.3-54-g00ecf