From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <6f3428794c36600244db89414a1ccd19@kw.quanstro.net> References: <4be4dd37.NDxcevbsQ+CfYFvN%yard-ape@telus.net> <104169d77ce3a909d635845ac86efc30@9netics.com> <6f3428794c36600244db89414a1ccd19@kw.quanstro.net> Date: Mon, 10 May 2010 13:17:05 +0100 Message-ID: From: roger peppe To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] Binary File split Topicbox-Message-UUID: 1eb067d6-ead6-11e9-9d60-3106f5b1d025 On 10 May 2010 12:40, erik quanstrom wrote: > this isn't awk's fault. =C2=A0awk gets the right result. =C2=A0you've ill= ustrated > 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