From owner-freebsd-questions@FreeBSD.ORG Tue Jan 24 22:11:56 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7335B16A41F for ; Tue, 24 Jan 2006 22:11:56 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from pi.codefab.com (pi.codefab.com [199.103.21.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 937EA43D6E for ; Tue, 24 Jan 2006 22:11:53 +0000 (GMT) (envelope-from cswiger@mac.com) Received: from localhost (localhost [127.0.0.1]) by pi.codefab.com (Postfix) with ESMTP id BE3585CFC; Tue, 24 Jan 2006 17:11:52 -0500 (EST) Received: from pi.codefab.com ([127.0.0.1]) by localhost (pi.codefab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05255-05; Tue, 24 Jan 2006 17:11:50 -0500 (EST) Received: from [192.168.1.3] (pool-68-160-211-174.ny325.east.verizon.net [68.160.211.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pi.codefab.com (Postfix) with ESMTP id 187645C17; Tue, 24 Jan 2006 17:11:50 -0500 (EST) Message-ID: <43D6A62B.80001@mac.com> Date: Tue, 24 Jan 2006 17:11:55 -0500 From: Chuck Swiger Organization: The Courts of Chaos User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: Ensel Sharon References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at codefab.com Cc: freebsd-questions@freebsd.org Subject: Re: shell scripting question (mdconfig device choosing) 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: Tue, 24 Jan 2006 22:11:56 -0000 Ensel Sharon wrote: > and I know how to use awk to strip away the leading "md" from each piece > of the output ... but I do not know how to take output like: > > 8 9 11 14 > > and decide that the lowest available number is "0". How can I do this ? % echo '9 8 11 14' | sort -nt ' ' | head -1 8 -- -Chuck