Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] binary search of binary data
- Date: Thu, 30 Dec 2004 01:34:04 +0900
- From: Edward Wright <edw@example.com>
- Subject: Re: [tlug] binary search of binary data
- References: <20041225205936.GA2199@example.com> <87llbjj4xw.fsf@example.com> <20041227145652.GC2199@example.com> <87fz1rhy0m.fsf@example.com> <20041228041814.GD2199@example.com> <871xd9hezi.fsf@example.com> <20041229145051.GE2199@example.com> <20041229151205.GA24615@example.com> <20041229154308.GG2199@example.com> <20041229155248.GA24770@example.com>
- User-agent: Mutt/1.4i
On Wed, Dec 29, 2004 at 07:52:48AM -0800, Dave Brown wrote: > On Thu, Dec 30, 2004 at 12:43:08AM +0900, Edward Wright wrote: > > On Wed, Dec 29, 2004 at 07:12:05AM -0800, Dave Brown wrote: > > echo is a shell builtin and printf is an external program. Save > the PIDs! (Shell builtins will run faster, if you have lots of > them.) Good point - although bash has a builtin printf (which wouldn't work anyway....) > > > > :) [~] echo -n $'\x26\x9d\x00\x00\x28\x9d\x00\x00' | od -t x1 > > > 0000000 26 9d 00 00 28 9d 00 00 > > > 0000010 > > > :) [~] > > > > > > > 1) again, I need the byte values, not the hex representation, so I'm > > not sure what this gets me... > > The "od -t x1" is just to demonstrate that the raw byte-value > output is, indeed, what I claim it is. Instead of piping it to > od, you can (say) dump it into a file. > Oh.... missed the point... my bad :) It seems that would work (and elegantly, if I were using zsh) > > 2) interestingly, when I used the exact command you used, I got > > different output: > > > > echo -n $'\x26\x9d\x00\x00\x28\x9d\x00\x00' | od -t x1 > > 0000000 26 9d > > 0000002 > > > > truncated at the null byte. Hmm... > > Oh, hrm, that's interesting. I'm using zsh, which preserves the > entire output. > > I just verified it with my bash-3.00 and it does, indeed, > truncate. I just sent in a bug report to the bash folks about > this--I think that's incorrect behaviour. I'll second that. Thanks, Ed
- References:
- [tlug] binary search of binary data
- From: Edward Wright
- Re: [tlug] binary search of binary data
- From: Stephen J. Turnbull
- Re: [tlug] binary search of binary data
- From: Edward Wright
- Re: [tlug] binary search of binary data
- From: Stephen J. Turnbull
- Re: [tlug] binary search of binary data
- From: Edward Wright
- Re: [tlug] binary search of binary data
- From: Stephen J. Turnbull
- Re: [tlug] binary search of binary data
- From: Edward Wright
- Re: [tlug] binary search of binary data
- From: Dave Brown
- Re: [tlug] binary search of binary data
- From: Edward Wright
- Re: [tlug] binary search of binary data
- From: Dave Brown
Home | Main Index | Thread Index
- Prev by Date: Re: [tlug] binary search of binary data
- Next by Date: Re: [tlug] binary search of binary data
- Previous by thread: Re: [tlug] binary search of binary data
- Next by thread: Re: [tlug] binary search of binary data
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links