You are not logged in.

#1 2009-04-03 02:40:21

sullivanva
Member
From: Herndon, VA USA
Registered: 2005-07-21
Posts: 126

tail broken [solved]

# pacman -Qo /usr/bin/tail
/usr/bin/tail is owned by coreutils 7.1-2

# tail +2 /etc/hosts
tail: cannot open `+2' for reading: No such file or directory
==> /etc/hosts <==
# /etc/hosts: static lookup table for host names
#

#<ip-address>    <hostname.domain.org>    <hostname>
127.0.0.1        localhost.localdomain    localhost

...

# End of file

Last edited by sullivanva (2009-04-05 04:16:34)


--HAPS

Offline

#2 2009-04-03 02:53:12

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,405
Website

Re: tail broken [solved]

I think you want "tail -2"

Offline

#3 2009-04-03 03:02:13

sullivanva
Member
From: Herndon, VA USA
Registered: 2005-07-21
Posts: 126

Re: tail broken [solved]

tail -2 does something different than tail +2

I have a workaround, though

Instead of

tail +2 <file>

use

tail -n +2 <file>

Not really solved though.


--HAPS

Offline

#4 2009-04-03 03:04:44

hacosta
Member
From: Mexico
Registered: 2006-10-22
Posts: 423

Re: tail broken [solved]

according to the manpage that is the correct behavior



tail [-f | -r] [-b number | -c number | -n number | -number] [file ...]   

note no +number

Offline

#5 2009-04-03 04:25:22

sullivanva
Member
From: Herndon, VA USA
Registered: 2005-07-21
Posts: 126

Re: tail broken [solved]

From the manpage:

-n, --lines=N
              output the last N lines, instead of the last 10; or  use  +N  to
              output lines starting with the Nth

Expected behaviour

# pacman -Qo /usr/bin/tail
/usr/bin/tail is owned by coreutils 6.12-1

# tail +2 /etc/hosts
# /etc/hosts: static lookup table for host names
#

#<ip-address>    <hostname.domain.org>    <hostname>

...

# End of file

--HAPS

Offline

#6 2009-04-03 16:28:46

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: tail broken [solved]

Read the manpage _carefully_ - what you want is
tail -n +2
or
tail --lines=+2

Offline

#7 2009-04-05 04:16:00

sullivanva
Member
From: Herndon, VA USA
Registered: 2005-07-21
Posts: 126

Re: tail broken [solved]

Actually, I was posting the information for your benefit, since it's a change that may mess up some of your scripts as it did mine.

See the following for reference.

https://bugzilla.redhat.com/show_bug.cgi?id=287751

They are not changing it back.


--HAPS

Offline

Board footer

Powered by FluxBB