dd: support iseek= and oseek=

Alias iseek=N to skip=N, oseek=N to seek=N (Bug#45648).
* src/dd.c (scanargs): Parse iseek= and oseek=.
* tests/dd/skip-seek.pl (sk-seek5): New test case.
This commit is contained in:
Paul Eggert
2022-02-21 11:23:02 -08:00
parent 3f7519130a
commit 4439ef3ec4
4 changed files with 27 additions and 10 deletions

View File

@@ -68,6 +68,16 @@ my @Tests =
{OUT=> "bc\n"},
{ERR=> "3+0 records in\n3+0 records out\n"},
],
[
# Check that iseek and oseek aliases work too.
'sk-seek5',
qw (bs=1 iseek=1 oseek=2 conv=notrunc count=3 status=noxfer of=@AUX@ < ),
{IN=> '0123456789abcdef'},
{AUX=> 'zyxwvutsrqponmlkji'},
{OUT=> ''},
{ERR=> "3+0 records in\n3+0 records out\n"},
{CMP=> ['zy123utsrqponmlkji', {'@AUX@'=> undef}]},
],
);
my $save_temps = $ENV{DEBUG};