Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Jan 2011 12:36:41 +0300 (MSK)
From:      "Igor V. Ruzanov" <igorr@canmos.ru>
To:        perryh@pluto.rain.com
Cc:        dscheidt@panix.com, freebsd-questions@freebsd.org
Subject:   Re: problem with shell script
Message-ID:  <Pine.LNX.4.64.1101131232470.18420@sta1.canmos.ru>
In-Reply-To: <4d2ec0ea.CdxRFqq6dJK4kMYu%perryh@pluto.rain.com>
References:  <4D2DB449.6070901@esiee.fr> <AANLkTimHU7kQXM0agHsfz=hHn2zuBuL4xihDxUWo3%2BvB@mail.gmail.com> <AANLkTikcH9jjNNf-1vwTzgxekH5bp%2BdXnnvh923f1NcM@mail.gmail.com> <AANLkTinkSOUm84RamXn8qToxb5YQG%2BH6VwOtKZJVy7nN@mail.gmail.com> <C756456F-3B1C-4210-BA40-3A064384A038@panix.com> <4d2ec0ea.CdxRFqq6dJK4kMYu%perryh@pluto.rain.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, 13 Jan 2011, perryh@pluto.rain.com wrote:

|David Scheidt <dscheidt@panix.com> wrote:
|
|> ps ax | grep [s]lapd | wc -l
|>
|> The [] creates a one-character class that doesn't match the regex.
|
|Doesn't [s]lapd need to be quoted?  [] are special to (at least some)
|shells.
Which FreeBSD version do you use? If it above 4.x you could try the 
following:

`pgrep slapd | wc -l'

 or maybe

`pgrep slapd | xargs ps | wc -l'

 or something like this, it depends on your criteria

+-------------------------------------------+
! CANMOS ISP Network                        !
+-------------------------------------------+
! Best regards                              !
! Igor V. Ruzanov, network operational staff!
! e-Mail: igorr@canmos.ru                   !
+-------------------------------------------+
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: For info see http://quantumlab.net/pine_privacy_guard/

iD8DBQFNLserbt6QiUlK9twRAvApAKCoIAozDT98VzRkvE3bjPg9Fb2OZwCeLCVj
l86YACf0Sd+Gu2vfujQNE/I=
=pls0
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.64.1101131232470.18420>