From 7331ab55fc28ac03c18cd683b7748a07dbd63f0f Mon Sep 17 00:00:00 2001 From: Pozsár Balázs Date: Mon, 24 Sep 2012 02:39:09 +0100 Subject: dd: new option, status=none to suppress output statistics * src/dd.c (STATUS_NONE): A new bitmask combining all STATUS_ options, thus used to suppress all informational output. (struct symbol_value statuses): Expose the "none" option, corresponding to the STATUS_NONE bitmask above. (print_stats): Return early if STATUS_NONE is specified. Also move the call to gethrxtime() down so that it's only called when needed. (usage): Describe the new options. * doc/coreutils.texi (dd invocation): Likewise. * NEWS: Mention the new feature. * tests/dd/misc.sh: Ensure the new option works. --- tests/dd/misc.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/dd') diff --git a/tests/dd/misc.sh b/tests/dd/misc.sh index 9a9bba1ea..f029a1116 100755 --- a/tests/dd/misc.sh +++ b/tests/dd/misc.sh @@ -30,6 +30,13 @@ echo data > $tmp_in || framework_failure_ ln $tmp_in $tmp_in2 || framework_failure_ ln -s $tmp_in $tmp_sym || framework_failure_ +# check status=none suppresses all output to stderr +dd status=none if=$tmp_in of=/dev/null 2> err || fail=1 +test -s err && fail=1 +# check status=none is cumulative with status=noxfer +dd status=none status=noxfer if=$tmp_in of=/dev/null 2> err || fail=1 +test -s err && fail=1 + dd if=$tmp_in of=$tmp_out 2> /dev/null || fail=1 compare $tmp_in $tmp_out || fail=1 -- cgit v1.2.3-70-g09d2