X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
From: mwoehlke <mwoehlke@tibco.com>
Subject:  Re: Possible bug in pgrep (procps)
Date:  Mon, 17 Jul 2006 17:48:58 -0500
Lines: 42
Message-ID: <e9h44r$3gr$1@sea.gmane.org>
References:  <3820.130.240.136.130.1153173646.squirrel@pinus.tt.luth.se>
Mime-Version:  1.0
Content-Type:  text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding:  7bit
User-Agent: Thunderbird 1.5.0.4 (X11/20060516)
In-Reply-To: <3820.130.240.136.130.1153173646.squirrel@pinus.tt.luth.se>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

Bengt-Arne Fjellner wrote:
> pgrep from procps-3.2.6-1 when asking for an exact match with arguments seems to
> demand an extra space after the argument.
> See the following sequence.
> 
> No space after the f on the commandline
> $ emacs f&
> [1] 2072
> 
> without extra space
> $ pgrep  -x -f "emacs f"
> 
> with extra space after f
> $ pgrep  -x -f "emacs f "
> 2072
> 
> Bug or my misunderstanding ?

Sure sounds like a bug, unless 'grep "foo"' is no longer supposed to 
match the line "foo "... 'man pgrep' isn't very specific on how the 
pattern matching is supposed to work, so I would assume partial matches 
are expected to work (as they would in grep).

Interestingly enough, on my computer (cygwin 1-5-19.4, procps 3.2.6-1), 
I see the following:

$ sleep 1h&
[1] 2136
$ pgrep -f 'sleep 1h'
2136
$ pgrep -f 'sleep 1h '
2136
$ pgrep -f 'sleep 1h  '
$

(Same results using ""s instead of ''s.)
This also seems wrong; 'sleep 1h ' should not have matched anything IMO. 
It does seem like there is something fishy going on.

-- 
Matthew
Interix, Sphinterix. Cygwin apps don't crash. :-)


--
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/

