delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/10/29/13:09:58

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
From: "Dave Korn" <dave DOT korn AT artimi DOT com>
To: <cygwin AT cygwin DOT com>
References: <f79359b60810290733t102346a1sb33f529eaa4da778 AT mail DOT gmail DOT com> <015901c939d8$b22295e0$9601a8c0 AT CAM DOT ARTIMI DOT COM> <f79359b60810291038y38a38473uad379133258bc94f AT mail DOT gmail DOT com>
Subject: RE: Problems with 'tail -n *'
Date: Wed, 29 Oct 2008 18:09:52 -0000
Message-ID: <017e01c939f1$8a605380$9601a8c0@CAM.ARTIMI.COM>
MIME-Version: 1.0
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <f79359b60810291038y38a38473uad379133258bc94f@mail.gmail.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Gustavo Seabra wrote on 29 October 2008 17:39:

>>  The "-NNN" form is an abbreviation for "-n NNN".  If you write it out
>> in full, it works: 
>> 
>> $ tail -n 2 *.dat
>> 
> 
> OK, I see that now. Thanks. But is there a reason why the abbreviation
> is not working in cygwin? It works just fine in a different system...

  From your original post:

> It works fine on a linux computer we have (tail (coreutils) 5.2.1).

> $ tail --version
> tail (GNU coreutils) 6.10

  So the reason is "because you're using different versions".  I would guess
that the behaviour was changed on purpose by the coreutils maintainers.
Looking at /usr/share/doc/coreutils-6.10/NEWS suggests there have been a
number of changes for POSIX conformance; and I notice:

"  In the following cases POSIX allows the default GNU behavior,
  so when POSIXLY_CORRECT is set:

  [ . . . ]

  tail supports two or more files when using the obsolete option syntax. "


  There may have been a regression arising; it doesn't seem to make any
difference to my testing if I set POSIXLY_CORRECT, or then again maybe
POSIXLY_CORRECT is defaulted on for Cygwin, because setting it on my Linux
system stops it from working and gives me an error message:

[dk AT ori ~]$ export POSIXLY_CORRECT=1
[dk AT ori ~]$ tail -2 *.txt
tail: too many arguments;  When using tail's obsolescent option syntax (-2)
there may be no more than one file argument.  Use the equivalent -n or -c
option instead.
[dk AT ori ~]$ 


  I see Eric (the cygwin coreutils maintainer) has just sent a reply; let's
see what he has to say.

    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019