From owner-freebsd-questions@FreeBSD.ORG Wed Jan 12 15:44:19 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 BB947106564A for ; Wed, 12 Jan 2011 15:44:19 +0000 (UTC) (envelope-from faust64@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6EE1C8FC19 for ; Wed, 12 Jan 2011 15:44:19 +0000 (UTC) Received: by qyk36 with SMTP id 36so696902qyk.13 for ; Wed, 12 Jan 2011 07:44:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=8sxt6hB/EBb4hvATg4/aShxlJgtRQ/gZL/t9vvW/1B4=; b=HbeTF/xlzloEhR6o0/VqrtD6mH6jJIMAByI55u3j/wSiESIHKFCJ33xu7+TNLTs+Dm 098/3uRPAZVdXG+yl1+QtpXp89Sp333uf1O9iYHFoEWzgTVp+g8g4h0kY67076g9vjwL Dl1c4DvQwjBfb11cWSjgmAqamwHk70405jcv8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=KRViGuv9w78vKdlGaCNRcKz144O2QJ7KwhY4lX22urhy/FaqCc5hPg4245kmtwFSbQ +0Co0Yf6wAMx6wFwwMH3qJ0wqttEcSKssayBdHETCGxBTF+aAh893dvL3IAQ+wirXzoW Qr+DX467RFcFkCPIyd98DpDG5lGv/1ZeFYU3s= Received: by 10.229.245.14 with SMTP id ls14mr995847qcb.19.1294847057786; Wed, 12 Jan 2011 07:44:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.77.215 with HTTP; Wed, 12 Jan 2011 07:43:37 -0800 (PST) In-Reply-To: References: <4D2DB449.6070901@esiee.fr> From: =?ISO-8859-1?Q?Samuel_Mart=EDn_Moro?= Date: Wed, 12 Jan 2011 16:43:37 +0100 Message-ID: To: Chad Kellerman Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Frank Bonnet , freebsd-questions@freebsd.org 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 15:44:19 -0000 On Wed, Jan 12, 2011 at 4:34 PM, Samuel Mart=EDn Moro wr= ote: > > > On Wed, Jan 12, 2011 at 3:50 PM, Chad Kellerman wrote= : > >> On Wed, Jan 12, 2011 at 9:01 AM, Frank Bonnet wrote: >> >> > Hello >> > >> > I'm in trouble with a simple shell script that give >> > erroneous value when running ... >> > >> > If I run commands interactively everything runs well >> > >> > > ps ax | grep slapd | grep -v grep | wc -l >> > 1 >> > >> > If I run in the following shell script : >> > >> > #!/bin/sh >> > SD=3D0 >> > SD=3D`ps -ax | grep slapd | grep -v grep | wc -l` >> > echo $SD >> > >> > the result is 3 !!! >> > >> > ps ax | grep "[/]slapd " | wc -l > ps ax | awk '/[/]slapd /{n++} END{print n}' sorry... > may not fix the problem > but still cleaner > >> > >> > Any info welcome ! >> > >> >> What's the name of your script? Hope it's not slapd_check.sh that will >> cause and extra count in the ps, cus it will count itself. >> >> >> Chad >> >> > >> > _______________________________________________ >> > freebsd-questions@freebsd.org mailing list >> > http://lists.freebsd.org/mailman/listinfo/freebsd-questions >> > To unsubscribe, send any mail to " >> > freebsd-questions-unsubscribe@freebsd.org" >> > >> >> >> >> -- >> A grasshopper walks into a bar and the bartender says "Hey, we have a >> drink >> named after you." And the grasshopper says "Really, You have a drink nam= ed >> Murray?" >> _______________________________________________ >> freebsd-questions@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-questions >> To unsubscribe, send any mail to " >> freebsd-questions-unsubscribe@freebsd.org" >> > > > > -- > Samuel Mart=EDn Moro > {EPITECH.} 2011 > CamTrace S.A.S > > "Nobody wants to say how this works. > Maybe nobody knows ..." > Xorg.conf(5) > --=20 Samuel Mart=EDn Moro {EPITECH.} 2011 CamTrace S.A.S "Nobody wants to say how this works. Maybe nobody knows ..." Xorg.conf(5)