3 # Copyright (C) 2012-2013 Free Software Foundation, Inc.
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 .
"${srcdir=.}/tests/init.sh"; path_prepend_ .
/src
22 echo 0123456789abcdefghijklm
> in || framework_failure_
23 dd count
=14 conv
=swab iflag
=count_bytes
< in > out
2> /dev
/null || fail
=1
30 echo 0123456789abcdefghijklm
> in || framework_failure_
31 dd skip
=10 iflag
=skip_bytes
< in > out
2> /dev
/null || fail
=1
37 # skip records and bytes from pipe
38 echo 0123456789abcdefghijklm |
39 dd skip
=10 bs
=2 iflag
=skip_bytes
> out
2> /dev
/null || fail
=1
47 dd bs
=5 seek
=8 oflag
=seek_bytes
> out
2> /dev
/null || fail
=1
48 printf '\0\0\0\0\0\0\0\0abcdefghijklm\n' > expected
49 compare expected out || fail
=1
51 # Just truncation, no I/O
52 dd bs
=5 seek
=8 oflag
=seek_bytes of
=out2 count
=0 2> /dev
/null || fail
=1
53 truncate
-s8 expected2
54 compare expected2 out2 || fail
=1