This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Possible bug in pgrep (procps)

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 "

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'
$ pgrep -f 'sleep 1h '
$ 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.

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

-- Unsubscribe info: Problem reports: Documentation: FAQ:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]