On 10 May 2010 12:40, erik quanstrom <[email protected]> wrote:
> this isn't awk's fault. awk gets the right result. you've illustrated
> the dismalness of seq.
good point. i should have worked that out!
it's not the first time i've been caught out by %g - perhaps
the default precision of %g should be 12 or more. at any
rate, seq's default format should be %.12g or better.
here's a version that works a bit better (also using seq -w so
that you can do "cat $file.*" to reassemble it)
{for(i in `{seq -w 0 `{ls -l $file | awk '{print int((int($6) - 1) /
'$bs')}'}}) {
dd -bs $bs -count 1 -quiet 1 -of $file.$i }
} < $file