Date: Wed, 12 Jan 2011 08:32:02 -0800 From: Chip Camden <sterling@camdensoftware.com> To: freebsd-questions@freebsd.org Subject: Re: problem with shell script Message-ID: <20110112163202.GC3068@libertas.local.camdensoftware.com> In-Reply-To: <4D2DB449.6070901@esiee.fr> References: <4D2DB449.6070901@esiee.fr>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] Quoth Frank Bonnet on Wednesday, 12 January 2011: > 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=0 > SD=`ps -ax | grep slapd | grep -v grep | wc -l` > echo $SD > > the result is 3 !!! > > > Any info welcome ! > > _______________________________________________ > 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" Ever hear of pgrep(1)? -- Sterling (Chip) Camden | sterling@camdensoftware.com | 2048D/3A978E4F http://camdensoftware.com | http://chipsquips.com | http://chipstips.com [-- Attachment #2 --] -----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-----help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110112163202.GC3068>
