Removing magic numbers

Net Llama! netllama
Mon May 17 12:02:18 PDT 2004


On 05/13/04 19:39, Alan Jackson wrote:
> My son has a friend who ftp'd a bunch of perl scripts from Windoze
> to a Linux box for CGI stuff. Windows stupidly (or purposely?) screwed
> up the magic number in the files so that they are not recognized
> as perl scripts and won't run.
> 
> He figured out how to use hexedit to get rid of the magic number and fix
> the problem, but now we're wondering about a better solution - a way to
> script it and clean up the files automagically. We could write a little
> C program, but surely there is another way out there somewhere?
> 
> All we need is a way to delete the first 3 bytes from a binary file.
> 

This isn't one of those dos2unix type things, is it?

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
L. Friedman                       	       netllama at linux-sxs.org
Linux Step-by-step & TyGeMo: 		    http://netllama.ipfox.com

  19:50:01  up 158 days, 23:21,  1 user,  load average: 0.47, 0.53, 0.45



More information about the Linux-users mailing list