From owner-freebsd-questions@FreeBSD.ORG Wed Jan 12 16:32:08 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55455106564A for ; Wed, 12 Jan 2011 16:32:08 +0000 (UTC) (envelope-from sterling@camdensoftware.com) Received: from wh2.interactivevillages.com (wh2.interactivevillages.com [75.125.250.34]) by mx1.freebsd.org (Postfix) with ESMTP id 1BE558FC16 for ; Wed, 12 Jan 2011 16:32:07 +0000 (UTC) Received: from 174-21-105-104.tukw.qwest.net ([174.21.105.104] helo=_HOSTNAME_) by wh2.interactivevillages.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1Pd3cB-00045d-8t for freebsd-questions@freebsd.org; Wed, 12 Jan 2011 08:32:04 -0800 Received: by _HOSTNAME_ (sSMTP sendmail emulation); Wed, 12 Jan 2011 08:32:02 -0800 Date: Wed, 12 Jan 2011 08:32:02 -0800 From: Chip Camden To: freebsd-questions@freebsd.org Message-ID: <20110112163202.GC3068@libertas.local.camdensoftware.com> Mail-Followup-To: freebsd-questions@freebsd.org References: <4D2DB449.6070901@esiee.fr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="O3RTKUHj+75w1tg5" Content-Disposition: inline In-Reply-To: <4D2DB449.6070901@esiee.fr> User-Agent: Mutt/1.4.2.3i Company: Camden Software Consulting URL: http://camdensoftware.com X-PGP-Key: http://pgp.mit.edu:11371/pks/lookup?search=0xD6DBAF91 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - wh2.interactivevillages.com X-AntiAbuse: Original Domain - freebsd.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - camdensoftware.com Subject: Re: problem with shell script X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Jan 2011 16:32:08 -0000 --O3RTKUHj+75w1tg5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoth Frank Bonnet on Wednesday, 12 January 2011: > Hello >=20 > I'm in trouble with a simple shell script that give > erroneous value when running ... >=20 > If I run commands interactively everything runs well >=20 > > ps ax | grep slapd | grep -v grep | wc -l > 1 >=20 > If I run in the following shell script : >=20 > #!/bin/sh > SD=3D0 > SD=3D`ps -ax | grep slapd | grep -v grep | wc -l` > echo $SD >=20 > the result is 3 !!! >=20 >=20 > Any info welcome ! >=20 > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" Ever hear of pgrep(1)? --=20 Sterling (Chip) Camden | sterling@camdensoftware.com | 2048D/3A978E4F http://camdensoftware.com | http://chipsquips.com | http://chipstips.= com --O3RTKUHj+75w1tg5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQEcBAEBAgAGBQJNLdeCAAoJEIpckszW26+R+bQH/iYef3ammlximoSigeYtNIyj dNo3FZj3EmfW+tJq+oXLF9Bvo2rXv8VFevP0OoCP+MHsSQGF2l0ekM3+JjE2rcj6 Kx3YGtOPnPCGbD4JZgnjDtqPczZy2BTX1T0QSTNins2vaCS32fCzxdT+JOq14J/9 Hvg0OgWcRI0qrrRcr1inUZ59MbwipJq0gfQZGudz3ATdfB21I2yewBst5h4/wC+Q ox8qBgPaBY8aLFtBgKJAsUwWcS4X3HhmYetyfH/4iH7wMkcUXPw/x73Ve0lN0IeO +jmYy15LFlcYpKi21q/UQQYu/dFe9wF1oQP7UGsyD+1x1ci8PGLGt9u1PrvI5Gs= =2fMX -----END PGP SIGNATURE----- --O3RTKUHj+75w1tg5--