problem with shell script

Igor V. Ruzanov igorr at canmos.ru
Thu Jan 13 09:36:46 UTC 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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

|David Scheidt <dscheidt at 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 at 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-----


More information about the freebsd-questions mailing list