From owner-freebsd-questions@FreeBSD.ORG Sun Jun 29 13:17:02 2008 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 E51941065670 for ; Sun, 29 Jun 2008 13:17:02 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from weak.local (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2E0158FC26; Sun, 29 Jun 2008 13:17:01 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <48678B4C.9070809@FreeBSD.org> Date: Sun, 29 Jun 2008 15:17:00 +0200 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: "Diego F. Arias R." References: <3b93bd110806290517k2050b114g984b9e4186a3beda@mail.gmail.com> In-Reply-To: <3b93bd110806290517k2050b114g984b9e4186a3beda@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Problem With ZFS 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: Sun, 29 Jun 2008 13:17:03 -0000 Diego F. Arias R. wrote: > Hi: > > Im testing the new ZFS feature on freebsd. On the page i got a script > to monitor kernel memory but the script dont works. > --------------------------------------------------------------------------------------------------------------------------------------------------- > #!/bin/sh - > > TEXT=kldstat | tr a-f A-F | awk 'BEGIN {print "ibase=16"}; NR > 1 > {print $4}' | bc | awk '{a+=$1}; END {print a}' > DATA=vmstat -m | sed 's/K//' | awk '{a+=$3}; END {print a*1024}' > TOTAL=echo $DATA $TEXT | awk '{print $1+$2}' > > echo TEXT=$TEXT, echo $TEXT | awk '{print $1/1048576 " MB"}' > echo DATA=$DATA, echo $DATA | awk '{print $1/1048576 " MB"}' > echo TOTAL=$TOTAL, echo $TOTAL | awk '{print $1/1048576 " MB"}' > --------------------------------------------------------------------------------------------------------------------------------------------------- > > link: > > http://wiki.freebsd.org/ZFSTuningGuide > > > > the error i got is > > freebsd# ./kernmem.sh > > -m: not found The script is nonsense, it's not valid sh syntax. I guess it got badly mangled by the wiki software. Kris