[Nottingham] [Talk] ***TODAY*** Wed 19/10/2005 Voice over IP {ML}

Robert Hart enxrah at nottingham.ac.uk
Wed Oct 19 16:44:28 BST 2005


On Wed, 2005-10-19 at 16:19 +0100, Graeme Fowler wrote:
> On Wed 19 Oct 2005 16:01:59 BST , Robert Hart <enxrah at nottingham.ac.uk> wrote:
> > For bonus points, whilst we're on the subject, why to head and tail not
> > work in exactly the same way? (i.e. you can do tail +10 but not head +10)
> 
> Umm...
> 
> head -n, tail -n work in the same way: display the first|last n lines 
> of a file.
> 
> tail +n starts at line n of a file and displays the rest - for head 
> there isn't an exact analogue of that, given that you start at line 1 
> and finish at -n.

There is. What if you want all but the last 10 lines of a file? That
should be head +10 by my logic?

head -10 = first 10 lines
tail -10 = last 10 lines
tail +10 = all but first 10 lines

Therefore, 
head +10 = all but last 10 lines.

Rob


-- 
Robert Hart <enxrah at nottingham.ac.uk>
University of Nottingham


This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.




More information about the Nottingham mailing list