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.
dd conv=fsync now synchronizes output even after a write error,
and similarly for dd conv=fdatasync.
+ dd now supports the aliases iseek=N for skip=N, and oseek=N for seek=N,
+ like FreeBSD and other operating systems.
+
timeout --foreground --kill-after=... will now exit with status 137
if the kill signal was sent, which is consistent with the behavior
when the --foreground option is not specified. This allows users to
@item of=@var{file}
@opindex of
Write to @var{file} instead of standard output. Unless
-@samp{conv=notrunc} is given, @command{dd} truncates @var{file} to zero
-bytes (or the size specified with @samp{seek=}).
+@samp{conv=notrunc} is given, truncate @var{file} before writing it.
@item ibs=@var{bytes}
@opindex ibs
use @var{bytes} as the fixed record length.
@item skip=@var{n}
+@itemx iseek=@var{n}
@opindex skip
+@opindex iseek
Skip @var{n} @samp{ibs}-byte blocks in the input file before copying.
If @samp{iflag=skip_bytes} is specified, @var{n} is interpreted
as a byte count rather than a block count.
@item seek=@var{n}
+@itemx oseek=@var{n}
@opindex seek
-Skip @var{n} @samp{obs}-byte blocks in the output file before copying.
-if @samp{oflag=seek_bytes} is specified, @var{n} is interpreted
+@opindex oseek
+Skip @var{n} @samp{obs}-byte blocks in the output file before
+truncating or copying.
+If @samp{oflag=seek_bytes} is specified, @var{n} is interpreted
as a byte count rather than a block count.
@item count=@var{n}
@item skip_bytes
@opindex skip_bytes
-Interpret the @samp{skip=} operand as a byte count,
+Interpret the @samp{skip=} or @samp{iseek=} operand as a byte count,
rather than a block count, which allows specifying
an offset that is not a multiple of the I/O block size.
This flag can be used only with @code{iflag}.
@item seek_bytes
@opindex seek_bytes
-Interpret the @samp{seek=} operand as a byte count,
+Interpret the @samp{seek=} or @samp{oseek=} operand as a byte count,
rather than a block count, which allows specifying
an offset that is not a multiple of the I/O block size.
This flag can be used only with @code{oflag}.
obs=BYTES write BYTES bytes at a time (default: 512)\n\
of=FILE write to FILE instead of stdout\n\
oflag=FLAGS write as per the comma separated symbol list\n\
- seek=N skip N obs-sized blocks at start of output\n\
- skip=N skip N ibs-sized blocks at start of input\n\
+ seek=N (or oseek=N) skip N obs-sized output blocks\n\
+ skip=N (or iseek=N) skip N ibs-sized input blocks\n\
status=LEVEL The LEVEL of information to print to stderr;\n\
'none' suppresses everything but error messages,\n\
'noxfer' suppresses the final transfer statistics,\n\
n_max = MIN (SIZE_MAX, IDX_MAX);
converted_idx = &conversion_blocksize;
}
- else if (operand_is (name, "skip"))
+ else if (operand_is (name, "skip") || operand_is (name, "iseek"))
skip = n;
- else if (operand_is (name, "seek"))
+ else if (operand_is (name + (*name == 'o'), "seek"))
seek = n;
else if (operand_is (name, "count"))
count = n;
{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};