delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/03/02/22:01:57

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
In-Reply-To: <4B8DCB6C.3010207@columbus.rr.com>
References: <4B8DCB6C DOT 3010207 AT columbus DOT rr DOT com>
Date: Tue, 2 Mar 2010 22:01:40 -0500
Message-ID: <2bf229d31003021901g4c7f3b8fu340c1be2886d5f3@mail.gmail.com>
Subject: Re: "tail" command does not work as advertised
From: Chris Sutcliffe <ir0nh34d AT gmail DOT com>
To: pmcferrin AT columbus DOT rr DOT com, cygwin AT cygwin DOT com
X-IsSubscribed: yes
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

> The "tail +4" commands does not work as advertised.  When given such command
> (advertised in man command), it complains it can't open the file.  With the
> command "tail +5 -", it produces the desired output with some junk on
> standard output.

As per the tail manpage:

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

Note that the +N notation is specific to --lines=, not the '-n'
shorthand.  The proper syntax for this example:

> $ ps -a | tail +5 -

Should be 'ps -a | tail --lines=+5 -' assuming you want the output
only starting from the fifth line.

Chris

-- 
Chris Sutcliffe
http://emergedesktop.org
http://www.google.com/profiles/ir0nh34d

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

- Raw text -


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