From owner-svn-src-all@FreeBSD.ORG Wed Feb 23 01:25:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 280A7106566B; Wed, 23 Feb 2011 01:25:09 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id ABDA88FC13; Wed, 23 Feb 2011 01:25:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 2CBC841C710; Wed, 23 Feb 2011 02:25:07 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id DfkS2-7SsEQy; Wed, 23 Feb 2011 02:25:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id E8BD741C735; Wed, 23 Feb 2011 02:25:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 2D8294448F3; Wed, 23 Feb 2011 01:23:50 +0000 (UTC) Date: Wed, 23 Feb 2011 01:23:50 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Josh Paetzel In-Reply-To: <201102221918.p1MJIukV018893@svn.freebsd.org> Message-ID: <20110223011759.W13400@maildrop.int.zabbadoz.net> References: <201102221918.p1MJIukV018893@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218959 - head/usr.sbin/pc-sysinstall/backend-query X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Feb 2011 01:25:09 -0000 On Tue, 22 Feb 2011, Josh Paetzel wrote: > Author: jpaetzel > Date: Tue Feb 22 19:18:56 2011 > New Revision: 218959 > URL: http://svn.freebsd.org/changeset/base/218959 > > Log: > Better method for grabbing disk name, dmesg may produce mangled output. > > Approved by: kib (mentor, implicit) > > Modified: > head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh > > Modified: head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh > ============================================================================== > --- head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Tue Feb 22 19:05:42 2011 (r218958) > +++ head/usr.sbin/pc-sysinstall/backend-query/disk-list.sh Tue Feb 22 19:18:56 2011 (r218959) > @@ -74,7 +74,7 @@ do > fi > > # Check the dmesg output for some more info about this device > - NEWLINE=$(dmesg | sed -n "s/^$DEV: .*<\(.*\)>.*$/ <\1>/p" | head -n 1) > + NEWLINE=$(camcontrol identify $DEV | grep "device model" | tr -s ' ' | sed 's |device model ||g') Sure sed works if there is a blank between s and the delimiter? May I suggest nothing shorter but two pipes less, though not exactly the same with regard to whitespace stripping in and after the device name but that could be fixed easily as well. camcontrol identify $DEV | awk '/device model/ { gsub("device model[[:space:]]*", ""); print; }' I am sure it can still be done way more clever but ... > if [ -z "$NEWLINE" ]; then > NEWLINE=" " > fi > -- Bjoern A. Zeeb You have to have visions! Stop bit received. Insert coin for new address family.