From owner-freebsd-questions@FreeBSD.ORG Fri Jul 2 03:39:08 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EF811065676 for ; Fri, 2 Jul 2010 03:39:08 +0000 (UTC) (envelope-from aiza21@comclark.com) Received: from avmxsmtp3.comclark.com (avmxsmtp3.comclark.com [202.69.191.117]) by mx1.freebsd.org (Postfix) with ESMTP id BAE908FC16 for ; Fri, 2 Jul 2010 03:39:06 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtYTAPf7LEzKRa3YOWdsb2JhbAAHh2eYCwEBAQE0Ab4WhSUEg2+Gbg X-IronPort-AV: E=Sophos;i="4.53,524,1272816000"; d="scan'208";a="6843446" Received: from unknown (HELO [10.0.10.3]) ([202.69.173.216]) by avmxsmtp3.comclark.com with ESMTP; 02 Jul 2010 11:39:04 +0800 Message-ID: <4C2D5F58.3050708@comclark.com> Date: Fri, 02 Jul 2010 11:39:04 +0800 From: Aiza User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Chip Camden , "questions@freebsd.org" References: <4C2D2839.3040909@comclark.com> <20100702000124.GG19474@libertas.local.camdensoftware.com> In-Reply-To: <20100702000124.GG19474@libertas.local.camdensoftware.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: 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 03:39:08 -0000 Chip Camden wrote: > On Jul 02 07:43, Aiza wrote: >> 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/.* //' < file > > assuming there are no trailing spaces on each line. > > Another alternative would be to create the list without all that detail: > > ls -1 > Wow do I feel stupid. You saw through my question to the underlying problem causing the need to strip off that stuff. I just changed the command from ls -l to ls -1 and got what I wanted in the first place. Thanks