From owner-freebsd-questions@FreeBSD.ORG Fri Dec 19 04:13:17 2003 Return-Path: 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 E1F0B16A4CE for ; Fri, 19 Dec 2003 04:13:17 -0800 (PST) Received: from lilith.bellavista.cz (bellavista.worldonline.cz [212.90.245.154]) by mx1.FreeBSD.org (Postfix) with ESMTP id 700CA43D49 for ; Fri, 19 Dec 2003 04:13:16 -0800 (PST) (envelope-from neuhauser@bellavista.cz) Received: from freepuppy.bellavista.cz (freepuppy.bellavista.cz [10.0.0.10]) by lilith.bellavista.cz (Postfix) with ESMTP id 2E35132; Fri, 19 Dec 2003 13:13:15 +0100 (CET) Received: by freepuppy.bellavista.cz (Postfix, from userid 1001) id 19FCC2FDA03; Fri, 19 Dec 2003 13:13:15 +0100 (CET) Date: Fri, 19 Dec 2003 13:13:15 +0100 From: Roman Neuhauser To: David Bear Message-ID: <20031219121315.GH987@freepuppy.bellavista.cz> Mail-Followup-To: David Bear , freebsd-questions@freebsd.org References: <20031215163033.H32172@asu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031215163033.H32172@asu.edu> User-Agent: Mutt/1.5.4i cc: freebsd-questions@freebsd.org Subject: Re: awk question, maybe X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Dec 2003 12:13:18 -0000 # David.Bear@asu.edu / 2003-12-15 16:30:33 -0700: > i would like to do something like > > df | awk '{print $1}' > > to capture all the current file systems. But I would like to strip > off the first and last lines, since these are generally -- not needed. > > the goal is to write a generalized script that can feed dump with all > the file systems on a box. I would use mount(8) instead: its output doesn't include any headers, but you'll still want to pass through only local filesystems, so it doesn't really matter: roman@freepuppy ~ 1006:0 > mount | awk '/\/dev\/(ad|da)/ {print $1}' /dev/ad0s1a /dev/ad0s1e roman@freepuppy ~ 1007:0 > df | awk '/\/dev\/(ad|da)/ {print $1}' /dev/ad0s1a /dev/ad0s1e -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html