Okay, I did the Google groups search, and read a bunch of man pages, and so on, and I’m NOT a Unix geek (yet).
I NEED to concatate two NON-TEXT files in a shell. These are both binary data files (PCL code if that’s important).
I’ve been focused on trying to do this in a shell script, so if there’s a perl way, that would work, too (I know nothing about perl other than the top line of a script says perl in it).
In return, I can show you how to get your networked inkjets working under Mac OS X!
You aren’t missing anything sinemora. Unlike, say, the dos-based “type” command, cat doesn’t filter unprintible characters unless you specifically tell it to, so you can use it to concatinate two binary files.
Just make sure you don’t do “cat file1 file2 >file1”, as that is almost never what you really want to do.
Ah, that is a very interesting lesson in recursion and globbing. And it also occurs in other circumstances. I first encountered it when I had a directory with files:
file.001.foo
file.002.foo
file.003.foo etc
I foolishly did this command:
cat file* > file.foo
Result? file.foo kept growing in size until it filled my hard disk, and then cat aborted. Ooops.
Yep, that’s the power of an operating system that assumes you know what you’re doing.
So lesson one here: Read the manpages and, if your system has them (I think most Linux systems do) the info files. This is supported by most commands, as well, and it can give you enough of a hint to pick the right arguments: