From owner-freebsd-questions@FreeBSD.ORG Thu Jan 13 12:58:31 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 E04B2106566C for ; Thu, 13 Jan 2011 12:58:31 +0000 (UTC) (envelope-from four.harrisons@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 74A0E8FC14 for ; Thu, 13 Jan 2011 12:58:31 +0000 (UTC) Received: by fxm16 with SMTP id 16so1718425fxm.13 for ; Thu, 13 Jan 2011 04:58:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:message-id:subject:from:to:date:mime-version :content-type:content-transfer-encoding; bh=Elw9IhgHU0NW6Py/htdx1OOgmg0Nv6HwKvO7V0fQNww=; b=K7qYRZQ4D4KWv6nD72rWoO8DFsoOo7aw6qpQN+yjKbj1msIpDOYxg1tNbTLEh6lt4p kdYRmso8Zl4HGNZDZFJuj76vrd8sd1TaFDnUt+JzceIVJ/8Qd6Ng3qgxRvRnWIBuMxk3 zYSGYoPGFxqCh2839QNq7oEAHWo7sLs7KnlW4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:subject:from:to:date:mime-version:content-type :content-transfer-encoding; b=jDA3nvBA5XbtjnZqNcrilryq5PsCd6vjFqgqSzYy3EAn24svi/mK7iAlqY7WZMu4AQ kByFid6Z8DBJYOrTveVtsWIxFmFGXHSZxB4+JV8pAFv65XFlecXp16fknY/31X6eM1Kb 5KoZFDDMMbnU7DPAsivUE3wck8zz657ED4uc8= Received: by 10.223.101.131 with SMTP id c3mr1316863fao.95.1294922066978; Thu, 13 Jan 2011 04:34:26 -0800 (PST) Received: from ecs ([213.8.162.222]) by mx.google.com with ESMTPS id n3sm9550faa.29.2011.01.13.04.34.24 (version=SSLv3 cipher=RC4-MD5); Thu, 13 Jan 2011 04:34:25 -0800 (PST) Message-ID: <4d2ef151.4310df0a.25b7.0199@mx.google.com> From: four.harrisons@googlemail.com To: freebsd-questions@freebsd.org Date: Wed, 12 Jan 2011 14:17:24 +0000 Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: 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: Thu, 13 Jan 2011 12:58:32 -0000 Hello=0D=0A=0D=0AI'm in trouble with a simple shell script that give=0D=0A= erroneous value when running ...=0D=0A=0D=0AIf I run commands interactive= ly everything runs well=0D=0A=0D=0A > ps ax | grep slapd | grep -v grep |= wc -l=0D=0A 1=0D=0A=0D=0AIf I run in the following shell script :=0D= =0A=0D=0A#!/bin/sh=0D=0ASD=3D0=0D=0ASD=3D`ps -ax | grep slapd | grep -v g= rep | wc -l`=0D=0Aecho $SD=0D=0A=0D=0Athe result is 3 !!!=0D=0A=0D=0A=0D=0A= Any info welcome !=0D=0A=0D=0A___________________________________________= ____=0D=0Afreebsd-questions@freebsd.org mailing list=0D=0Ahttp://lists.fr= eebsd.org/mailman/listinfo/freebsd-questions=0D=0ATo unsubscribe, send an= y mail to "freebsd-questions-unsubscribe@freebsd.org"=0D=0A