![](https://seccdn.libravatar.org/avatar/b12cfb65ca4faebc3e3aac17838e8f8d.jpg?s=120&d=mm&r=g)
Donn, On Saturday 23 October 2004 15:47, you wrote:
Binary files - are you sure?
Of course. There are only files on Unix (or Solaris or Linux, etc.). There are no "text files" fundamentally distinct form "binary files." Just files. In its default mode of operation, "cat" does not in any way alter the contents of the files it reads. It quite literally just concatenates them.
If they are text files try "cat file1 file2 >> file3"
This will append to anything that may already be in "file3." I don't believe that's what the original poster wanted to do. Randall Schulz
Randall R Schulz wrote:
John,
On Saturday 23 October 2004 11:41, John N. Alegre wrote:
How can I join a series of binary files, file.000, file.001,file.002 .. etc.etc?
I have tried
for i in file.0* do cat $i done > file.whatever
This does work to create the large file but the sum is not correct.
First of all, it's easier to just do this:
% cat file.0* >file.whatever
This (or your loop) will indeed simply concatenate the input files with no further manipulation or alteration of their contents.
Next, what sum do you mean? The output of "sum", "cksum" or "md5sum", perhaps? The sums created by those programs on the concatenation of several input files will never be equal to the sum of each individual file's checksum.
All of the stock Unix / Linux checksumming programs compute values that are sensitive not only to the bytes (or words or even 128-bit chunks) of the file, but also to their order.
Thanks john
Randall Schulz
![](https://seccdn.libravatar.org/avatar/78a7479309bd77a4e35763923b6f21ba.jpg?s=120&d=mm&r=g)
Randall R Schulz wrote:
Donn,
On Saturday 23 October 2004 15:47, you wrote:
Binary files - are you sure?
Of course. There are only files on Unix (or Solaris or Linux, etc.). There are no "text files" fundamentally distinct form "binary files." Just files.
In its default mode of operation, "cat" does not in any way alter the contents of the files it reads. It quite literally just concatenates them.
Another thing newbies don't realize about cat is that unlike "type" in the dos world, it will blast data to devices if you wish. To Donn: try cat something.au > /dev/audio like so: cat torvalds-says-linux.au > /dev/audio Also check out "dog" DESCRIPTION dog writes the contents of each given file, URL, or the standard input if none are given or when a file named '-' is given, to the standard output. It currently supports the file, http, and raw URL types. It is designed as a compatible, but enhanced, replacement of cat(1). -- Dan
participants (2)
-
Daniel Podgurski
-
Randall R Schulz