Package: coreutils
Version: 8.5-1
Severity: wishlist
Hello,
I understand that dd's "blocks in/out" lines on stderr are somewhat of a
historical thing, however they are rather hard to silence:
# This will also suppress legitimate error messages:
$ dd if=/DOES-NOT-EXIST of=/dev/null 2>/dev/null
$
# This will hide dd's exit status replacing it with grep's:
$ dd status=noxfer if=/dev/zero of=/dev/null count=1 2>&1| grep -Ev 'records
(in|out)$'
$ echo $?
1
# This adds a dependency on moreutils:
$ mispipe "dd status=noxfer if=/dev/zero of=/dev/null count=1 2>&1" "grep -Ev
'records (in|out)$'"
$ echo $?
0
# This requires a temporary file and is rather ridiculous (and
# untested):
#!/bin/sh
TMPFILE=`mktemp`
cleanup()
{
rm -f "$TMPFILE"
}
trap cleanup EXIT
dd status=noxfer if=/dev/zero of=/dev/null count=1 2> $TMPFILE
RES=$?
grep -Ev 'records (in|out)$' $TMPFILE >&2
exit $RES
# This is lovely but is much slower than dd with a large bs, since
# head will only read 8k blocks and write them in 2 4k write() calls:
$ head -c 500M /dev/zero > file.img
$
Something like this (using what's in #194556 as an example) would make
my life remarkably easier:
$ dd verbosity=none if=/dev/zero of=file.img bs=1M count=500
$
Ciao,
Enrico
-- System Information:
Debian Release: wheezy/sid
APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 3.0.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages coreutils depends on:
ii libacl1 2.2.51-3 Access control list shared library
ii libattr1 1:2.4.46-3 Extended attribute shared library
ii libc6 2.13-10 Embedded GNU C Library: Shared lib
ii libselinux1 2.0.98-1.1 SELinux runtime shared libraries
coreutils recommends no packages.
coreutils suggests no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]