From owner-freebsd-questions@FreeBSD.ORG Wed Oct 29 22:28:27 2008 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82F681065675 for ; Wed, 29 Oct 2008 22:28:27 +0000 (UTC) (envelope-from dudu.meyer@gmail.com) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.29]) by mx1.freebsd.org (Postfix) with ESMTP id 27B208FC19 for ; Wed, 29 Oct 2008 22:28:26 +0000 (UTC) (envelope-from dudu.meyer@gmail.com) Received: by yw-out-2324.google.com with SMTP id 9so93471ywe.13 for ; Wed, 29 Oct 2008 15:28:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=TIz8ap7AYJhnpo20dAr/boqDzC2QNkegbs7j8/bMYZI=; b=HmEepCGacvGkowM5jvCH/zDteVTCByzeuII8tCtv8FNjE2Dli0YzIAgaveEKK9yYKG ITLBU2Hw7eKPQXDh+5F0mSF1UCvbsttAr9vjbbsm6difSJsYjGrvcuP6Wjl9xDYwKNfD h/xQ/GlRN6LSgWFoHwC7Xxcs0cy4EhXRD4KDc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=K/K6hHeLk5n9TVjFK6f+ty7k1+veyv1cPNeOil/Ef3/F86D2U6CwSMO83pWYmN8DKD CJJeuGxULRJijOps4c8hqJ+SW+nVO+6u+qaD6Vi18JLllCzkOhx9FV7GBc5PpO5TJ6zv tpU2OK7H+xlpKzCK3Afh9Rf4bpdiP808phakc= Received: by 10.64.185.18 with SMTP id i18mr9813211qbf.65.1225317763100; Wed, 29 Oct 2008 15:02:43 -0700 (PDT) Received: by 10.64.201.9 with HTTP; Wed, 29 Oct 2008 15:02:43 -0700 (PDT) Message-ID: Date: Wed, 29 Oct 2008 20:02:43 -0200 From: "Eduardo Meyer" To: stable@freebsd.org, questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Cc: Subject: Script-friendly (parseble) ps(1) output? 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, 29 Oct 2008 22:28:27 -0000 Hello, I need to write a cgi script which will print the output from ps(1) in a table (html), so the average-operator can click on a KILL link and the cgi will send the selected signal. I need to add one ps information per column in a table (html), however, I found ps(1) output to be too hard to parse. There is no separator. I believed \t was the separator but its not. The ps(1) command I need to use is: ps -ax -o pid -o user -o emul -o lstart -o lockname -o stat -o command Since many of those args use [:space:] in the output, I can not use [:space:] as a separator. Sadly, `-o fiend='value'` will only format the HEADER output, not the values. Ive got no clue what to do, can someone enlight me? Thank you all in advance. -- =========== Eduardo Meyer pessoal: dudu.meyer@gmail.com profissional: ddm.farmaciap@saude.gov.br