[Techtalk] Copying a file + archive to one file

Wolfgang Petzold petzold at villa-chaos.de
Fri Feb 24 09:20:26 EST 2006


Becky Brewer:
> I'm trying to copy a file plus a zip archive into
> one file (an exe), and from what I've read the cp command is not able to do
> this.   In DOS, the command I would use to perform this action is:
> copy /B myapp.exe+myzip.zip mynewapp.exe

You can use the "cat" command for con*cat*enating files. (I once
read it would be the UNIX philosophy to have a bunch of commands
each doing one simple job, but doing that well; so "cat" concatenates
files, whereas "cp" copies files.)

So, together with output redirection you could say:

cat myapp.exe myzip.zip > mynewapp.exe

I have no idea if the newly created "mynewapp.exe" would be
an executable at all. It would be the data of the two former
files concatenated byte by byte.


More information about the Techtalk mailing list