Timeline for How to use bash script to read binary file content?
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 9, 2011 at 17:30 | history | edited | Peter.O | CC BY-SA 3.0 |
added 408 characters in body
|
| Apr 9, 2011 at 17:13 | comment | added | Peter.O | Yes thanks. I thought of using /dev/random but figured the test data gen was of no great import, and I wanted to test drive 'numrandom' (whicn you mentioned elsewhere; 'num-utils'some nice features.). I've just taken a closer look at your answer, and realized that you are doing pretty much the same thing, except that it is more succinct :).. I hadn't notice that you had stated the key points in 3 lines! I had focused on your other-language references.. Getting it to work was a good experience, and I now understand better your references to other-languages! \x00 can be a shell-stopper | |
| Apr 9, 2011 at 16:14 | history | edited | Peter.O | CC BY-SA 3.0 |
added 179 characters in body
|
| Apr 9, 2011 at 16:07 | history | edited | Peter.O | CC BY-SA 3.0 |
added 166 characters in body
|
| Apr 9, 2011 at 16:01 | comment | added | Gilles 'SO- stop being evil' |
Your code looks more complicated than it should be, especially the random test data generator. You can get random bytes from /dev/urandom on most unices. And random test data isn't the best test data, you should make sure to address difficult cases such as, here, null characters and newline in boundary places.
|
|
| Apr 9, 2011 at 16:00 | history | edited | Peter.O | CC BY-SA 3.0 |
added 35 characters in body
|
| Apr 9, 2011 at 15:50 | history | edited | Peter.O | CC BY-SA 3.0 |
added 24 characters in body; added 3 characters in body; deleted 39 characters in body; added 79 characters in body
|
| Apr 9, 2011 at 15:44 | history | answered | Peter.O | CC BY-SA 3.0 |