On Monday 17 Jan 2011, Ralph Corderoy wrote:
> > Now my understanding of cat goes back to a noddy Unix course about
> > 15-20 years ago, but I always thought the 'cat' stood for 'catalogue'
> > and was used to list the content of a text file.  Having looked at
> > http://unixhelp.ed.ac.uk/CGI/man-cgi?cat though, I now know that it
> > stands for concatenate
> 
> That man page is wrong!  It doesn't stand for concatenate, else it would
> be con(1), not cat(1).  :-)  It stands for catenate, always has done.
> Here's the man page from the 7th Edition of Unix from Bell Labs.
> 
>     wget -qO- http://www.cs.bell-labs.com/7thEdMan/vol1/man1.bun |
>     sed -n '/^-\.TH CAT/,/GO\.SYSIN DD/s/-//p' |
>     nroff -man

I never even knew that catenate was a word ;-)

> Back to Terry:
> > My flawed experience told me that cat was used with text files and the
> > man page I found earlier certainly didn't make it clear that any files
> > could be cat'd together.  Whether that makes any sense clearly depends
> > on what those files are, but having understood that fact I was able to
> > get to the next step; gzip files wouldn't be broken because of the way
> > they are structured.
> 
> Unix doesn't fundamentally distinguish between text and binary files at
> the kernel level as other OSes do.  They're just a sequence of zero or
> more bytes.  Unless stated otherwise, assume a command doesn't care
> whether the bytes could be considered as a LF-terminated sequence of
> zero or more lines of printable bytes.  Not having the text/binary
> distinction is quite an advantage compared to, e.g. DOS, which also has
> its ASCII SUB, Ctrl-Z, file terminating byte;  awful, mixing data and
> metadata.

I knew that really :-)  The trouble is that I had only ever used cat with text 
files, so it never even occured to me, in this context, that a file is a file 
and it doesn't matter what is in it.

-- 
                Terry Coles
                64 bit computing with Kubuntu Linux


--
Next meeting:  Bournemouth, Tuesday 2011-02-01 20:00
Meets, Mailing list, IRC, LinkedIn, ...  http://dorset.lug.org.uk/
How to Report Bugs Effectively:  http://goo.gl/4Xue

Reply via email to