Can't I get a /dev/one?
Nifty Hat Mitch
mitch48 at sbcglobal.net
Tue Jul 20 22:08:57 UTC 2004
On Wed, Jul 14, 2004 at 01:53:12AM -0400, William M. Quarles wrote:
> Chris Adams wrote:
> >Once upon a time, William M. Quarles <walrus at bellsouth.net> said:
> >
> >>>man tr
>
> Wow, that man page was difficult to comprehend... pretty abstract...
...
> Looks like that will take a lot longer than dd, because it's only
> reading in one byte at a time.
$ cat one.c
#include <stdio.h>
main()
{
int i;
for ( i=0; i<= (512-1); i++ ) {
fputc((int) 0xff, stdout );
/* 0xff can be ~0x00, 0x00, 0xA5, ~0xA5, 0x5A depending... */
}
}
===
Compile
cc one.c
Test....
$ a.out| od -x
0000000 ffff ffff ffff ffff ffff ffff ffff ffff
*
0001000
$ a.out | wc
0 0 512
Change the code or use a shell wrapper to get different chunk/ byte counts.
Of interest A5 and 5A reverse the bits in good ways for those that
want to wipe a disk.
0xA5==10100101
0x5A==01011010
--
T o m M i t c h e l l
/dev/dull where insight begins.
More information about the fedora-list
mailing list