bug-textutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: simple patch to cat


From: Bob Proulx
Subject: Re: simple patch to cat
Date: Sat, 14 Dec 2002 22:06:47 -0700
User-agent: Mutt/1.4i

Hunter Peress <address@hidden> [2002-12-13 18:50:15 -0600]:
> try tail on multiple files, it will show a divider marking the end of
> one file, and the beginning of another.
> 
> cat does not have this behaviour.

That is correct.  If you were to look at the synopsis line for cat it
says:

       cat - concatenate files and print on the standard output

Which is exactly what cat does, concatenate files.  Imagine dividing a
file into parts using the 'split' command.  Transporting the parts
individually.  Then joining the parts up again into the original file
contents using the 'cat' command.  If it added dividers then the file
would be corrupted.

The 'tail' and 'head' commands do something different.  They take and
output parts of files and are designed for human consumption.

If you wanted to simulate the behavior of 'cat' but with the dividers
of 'head' and 'tail' then you can use tail for that purpose.

  tail -n +1 file1 file2 [...]

By the way, there was some list discussion to this effect.  But you
were not CC'd and so I posted this summary including you in the
address list.  (This was much easier for me than thinking up the reply
myself. :-)

Bob



reply via email to

[Prev in Thread] Current Thread [Next in Thread]