From owner-freebsd-questions@FreeBSD.ORG Fri Jul 2 00:49:29 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 1BF531065670 for ; Fri, 2 Jul 2010 00:49:29 +0000 (UTC) (envelope-from bf1783@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id A671F8FC16 for ; Fri, 2 Jul 2010 00:49:28 +0000 (UTC) Received: by fxm13 with SMTP id 13so2021670fxm.13 for ; Thu, 01 Jul 2010 17:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:reply-to:date :message-id:subject:from:to:cc:content-type; bh=tmk2BA+nsuruyFFHQb4HHB9J4Ci0iceHdOtaKhgyKKs=; b=QSqKBfmXNnQK7xSzHX23Yo7F+HDnNM2nh8zP2nvccysDbp8KFrdxm0ezkbdyCLlRlQ LzZYPvVdbeAcLKf/6SOA7eE5FdAtk0oNpXDZLmRMflFmTMmYtJPmdhKX27xCPWPvimPJ IncEXVLVBCt931qNFYj+7nwTZT/aFpBRkT82s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:reply-to:date:message-id:subject:from:to:cc :content-type; b=OgDAr6l1PrtIDdegqGXavfifzrxrDxaKBWE7lBhKY16tqcBJtvptYWF4cFMcmmfBAI ITOvsNpvdqWOQ/HeqHu52nYYyUjRUzo5eaedSlROtMGJsMhp60CVai3PvF0rRphhh4R/ Y1Af8lGFzdRLAqhnRUJzEXdIAfXvOYi+uEBAI= MIME-Version: 1.0 Received: by 10.239.167.142 with SMTP id g14mr44512hbe.1.1278031755001; Thu, 01 Jul 2010 17:49:15 -0700 (PDT) Received: by 10.239.173.204 with HTTP; Thu, 1 Jul 2010 17:49:14 -0700 (PDT) Date: Thu, 1 Jul 2010 20:49:14 -0400 Message-ID: From: "b. f." To: Aiza Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-questions@FreeBSD.org Subject: Re: Bourne .sh ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bf1783@gmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jul 2010 00:49:29 -0000 >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? By using something like: awk '{print $9}' nameofmyfile (Or whatever column it is, if not the ninth.) Or you can use sed(1). Or cut(1). Or colrm(1)... I'd recommend first reading some of the base system manpages, and tutorials on basic text processing tools and shell programming than can be found in many places on the web, before addressing a lot of questions like this to a FreeBSD-specific list. Regards, b.