From: Skip Tavakkolian <9nut@9netics.com>
To: 9fans@9fans.net
Subject: Re: [9fans] Binary File split
Date: Mon, 10 May 2010 10:26:55 -0700 [thread overview]
Message-ID: <ed5b7e344e79a74240e5131eca0d028b@9netics.com> (raw)
In-Reply-To: <AANLkTimUrcZVSbSZLJuQiDLK9T5sk5j8QOdAQh53fgMz@mail.gmail.com>
# usage: sledge /tmp/foo /tmp/bar 31415
# could also be named crowbar
fn sledge () {
ifile=$1
ofile=$2
size=$3
if (~ $#* 3) {
for (i in `{seq 0 `{ls -l $ifile | awk '{print int($6/'^$size^')}'}}) {
echo dd -if $ifile -of $ofile^$i -bs $size -skip $i -count 1
}
}
}
>> 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
next prev parent reply other threads:[~2010-05-10 17:26 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-04 10:58 [9fans] BibTex collections of all 4 proceedings EBo
2010-05-04 19:59 ` [9fans] iwp9.org (Re: BibTex collections of all 4 proceedings) Jonas Amoson
2010-05-06 14:55 ` erik quanstrom
2010-05-06 15:12 ` Jeff Sickel
2010-05-06 16:00 ` ron minnich
2010-05-06 16:01 ` erik quanstrom
2010-05-06 16:18 ` ron minnich
2010-05-06 17:13 ` tlaronde
2010-05-06 19:52 ` EBo
2010-05-06 17:45 ` Wes Kussmaul
2010-05-06 18:12 ` Skip Tavakkolian
2010-05-06 18:35 ` ron minnich
2010-05-06 19:46 ` Skip Tavakkolian
2010-05-06 20:36 ` ron minnich
2010-05-06 21:21 ` Skip Tavakkolian
2010-05-06 21:45 ` ron minnich
2010-05-06 21:55 ` Skip Tavakkolian
2010-05-06 23:03 ` erik quanstrom
2010-05-06 23:08 ` ron minnich
2010-05-06 23:13 ` erik quanstrom
2010-05-07 0:16 ` Christopher Nielsen
2010-05-07 0:35 ` balaji
2010-05-07 0:47 ` Skip Tavakkolian
2010-05-07 13:09 ` Eric Van Hensbergen
2010-05-07 13:59 ` Paul Lalonde
2010-05-07 14:48 ` ron minnich
2010-05-07 15:37 ` Ramon de Vera
2010-05-07 15:47 ` David Leimbach
2010-05-07 23:11 ` Mathieu Lonjaret
2010-05-08 0:04 ` ron minnich
2010-05-08 11:34 ` tlaronde
2010-05-08 16:48 ` erik quanstrom
2010-05-08 17:33 ` tlaronde
2010-05-08 17:45 ` ron minnich
2010-05-08 21:34 ` David Leimbach
2010-05-12 16:08 ` Chad Brown
2010-05-12 16:26 ` Rodolfo (kix)
2010-05-12 17:06 ` ron minnich
2010-05-13 18:16 ` EBo
2010-05-13 23:26 ` Chad Brown
2010-05-13 23:40 ` ron minnich
2010-05-14 2:45 ` EBo
2010-05-14 3:14 ` ron minnich
2010-05-14 3:18 ` EBo
2010-05-14 3:27 ` erik quanstrom
2010-05-14 3:41 ` ron minnich
2010-05-14 2:24 ` Jeff Sickel
2010-05-14 3:14 ` ron minnich
2010-05-15 1:53 ` Jeff Sickel
2010-05-15 1:59 ` ron minnich
2010-05-15 2:04 ` Jeff Sickel
2010-05-15 2:27 ` EBo
2010-05-15 3:22 ` ron minnich
2010-05-15 3:58 ` EBo
2010-05-15 15:45 ` Kim Shrier
2010-05-15 16:12 ` EBo
2010-05-15 16:31 ` Kim Shrier
2010-05-15 19:46 ` ron minnich
2010-05-15 21:52 ` EBo
2010-05-08 3:40 ` [9fans] Binary File split Yard Ape
2010-05-08 4:41 ` erik quanstrom
2010-05-08 5:39 ` Skip Tavakkolian
2010-05-08 17:35 ` Russ Cox
2010-05-10 7:57 ` roger peppe
2010-05-10 8:26 ` Arvindh Rajesh Tamilmani
2010-05-10 8:28 ` Tharaneedharan Vilwanathan
2010-05-10 11:40 ` erik quanstrom
2010-05-10 12:17 ` roger peppe
2010-05-10 14:01 ` gas
2010-05-10 14:52 ` Iruata Souza
2010-05-10 15:17 ` Ethan Grammatikidis
2010-05-10 15:39 ` erik quanstrom
2010-05-10 16:01 ` Ethan Grammatikidis
2010-05-11 1:39 ` Derek Thomas
2010-05-10 17:26 ` Skip Tavakkolian [this message]
2010-05-06 21:55 ` [9fans] iwp9.org (Re: BibTex collections of all 4 proceedings) EBo
2010-05-07 3:36 ` John Floren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ed5b7e344e79a74240e5131eca0d028b@9netics.com \
--to=9nut@9netics.com \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).