coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dd: add 'skip_bytes' and 'count_bytes' operands


From: Erik Auerswald
Subject: Re: dd: add 'skip_bytes' and 'count_bytes' operands
Date: Wed, 8 Feb 2012 19:20:42 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

Hi,

On Wed, Feb 08, 2012 at 09:05:43AM -0700, Eric Blake wrote:
> On 02/08/2012 08:14 AM, Jérémy Compostella wrote:
> >> That leads onto the only other possible implementation I suppose.
> >> I.E. since we don't need to specify skip and skip_bytes together,
> >> the option value could select between each mode. I.E.
> >>
> >> skip=2      => skip    2 blocks,
> >> skip=2b     => skip 1024 blocks,
> >> skip=2bytes => skip    2 bytes
> >>
> >> Hmm, that's not too bad at all really
> > I do agree, it looks like a very interesting idea indeed. However, I
> > have two questions:
> > 1. Why skip=2b => 1024 blocks ?
> 
> Because POSIX requires that one.
> http://pubs.opengroup.org/onlinepubs/9699919799/utilities/dd.html

I don't think so.

> For the bs=, cbs=, ibs=, and obs= operands,

skip= is not in this list.

> the application shall supply
> an expression specifying a size in bytes. The expression, expr, can be:

skip=n
  Skip n input blocks

The expression given to skip is specified as being in blocks. POSIX does
not specify that skip recognizes a b suffix. It does not specify that b
means blocks^2 in this case neither.

IMHO skip=2b should be the same as skip=2 (or result in an error, if
silently ignoring the superfluous b suffix is not acceptable).

>     A positive decimal number
> 
>     A positive decimal number followed by k, specifying multiplication
> by 1024
> 
>     A positive decimal number followed by b, specifying multiplication
> by 512
> 
>     Two or more positive decimal numbers (with or without k or b)
> separated by x, specifying the product of the indicated values

All of the above do not apply to skip.

Thanks,
Erik



reply via email to

[Prev in Thread] Current Thread [Next in Thread]