Removing magic numbers

Joel Hammer joel
Mon May 17 12:02:18 PDT 2004


cat junk | sed "1s/^...//"

This removes the first three characters of any file,
maybe including binary files (I tried it with ogg123,
and it seemed to work.)

You could try:
     vi -b *(all files you want to change).

Use
     :ls
to see which files you have loaded.

You could then just 
     :bn!
to go to each file, and delete the first three characters by hand.
For example, just delete the first three characters in the first file, then
     :bn!
to jump to the next file, and use the "." to repeat those
keystrokes.

When done, use 
     :wall
to save all your changes.

Make backups before you start.

Joel




More information about the Linux-users mailing list