From owner-freebsd-questions@FreeBSD.ORG Fri Jul 2 00:46:25 2010 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 04BC4106564A for ; Fri, 2 Jul 2010 00:46:25 +0000 (UTC) (envelope-from prvs=079258342e=johnl@iecc.com) Received: from gal.iecc.com (gal.iecc.com [64.57.183.53]) by mx1.freebsd.org (Postfix) with ESMTP id 8C1C48FC14 for ; Fri, 2 Jul 2010 00:46:24 +0000 (UTC) Received: (qmail 44993 invoked from network); 2 Jul 2010 00:14:53 -0000 Received: from mail1.iecc.com (64.57.183.56) by mail1.iecc.com with QMQP; 2 Jul 2010 00:14:53 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=iecc.com; h=date:message-id:from:to:subject:in-reply-to:cc:mime-version:content-type:content-transfer-encoding; s=k1007; olt=johnl@user.iecc.com; bh=HP/Gf8sRe52eF1UJpndIGx7qf40c2HIPinNJC/zyucE=; b=gRfxya+EGHZOZb0cNqGO/PHNxSbduBJCOWZuvw1dCm/zGp0GAy1AceTmibQ1u8a/XUa20QWPVW+1TUTDkpi3sttdnLMu646oJpNIbU6xbbdjRS6k2pzDJRUP+Is6B8ewU6ruILkVkX/UY9XQL2Cw7DrJd1XyDtwYVxunTYK86Jw= Date: 2 Jul 2010 00:19:43 -0000 Message-ID: <20100702001943.37629.qmail@joyce.lan> From: John Levine To: freebsd-questions@freebsd.org In-Reply-To: <4C2D2839.3040909@comclark.com> Organization: X-Headerized: yes Mime-Version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: 7bit Cc: aiza21@comclark.com Subject: Re: Bourne .sh ? 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: Fri, 02 Jul 2010 00:46:25 -0000 In article <4C2D2839.3040909@comclark.com> you write: >I have a file containing this > >drwxrwxr-x 14 89987 546 512 Jun 6 2009 7.2-RELEASE >drwxrwxr-x 14 89987 546 512 Mar 23 04:59 7.3-RELEASE >drwxrwxr-x 13 89987 546 512 Nov 23 2009 8.0-RELEASE >drwxrwxr-x 13 89987 546 512 Jul 1 04:56 8.1-RC2 > >I want to strip off everything to the left of the release >version so I end up with this. > >7.2-RELEASE >7.3-RELEASE >8.0-RELEASE >8.1-RC2 > >How would I code to do this? sed -e 's/.* //' firstfile > secondfile awk '{ print $9}' firstfile > secondfile There are far more complicated methods, too. R's, John