From owner-freebsd-questions@FreeBSD.ORG Thu Jun 3 00:45:39 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 E6E4E1065678 for ; Thu, 3 Jun 2010 00:45:39 +0000 (UTC) (envelope-from vinny-mail-01+freebsd20100602@palaceofretention.ca) Received: from www.giovannetti.ca (www.giovannetti.ca [206.248.136.48]) by mx1.freebsd.org (Postfix) with ESMTP id B03618FC15 for ; Thu, 3 Jun 2010 00:45:39 +0000 (UTC) Received: from the.palaceofretention.ca (intgateway.palaceofretention.ca [10.10.10.42]) by www.giovannetti.ca (Postfix) with ESMTPSA id 2B0042280C for ; Wed, 2 Jun 2010 20:38:28 -0400 (EDT) Message-ID: <4C06F680.1000608@palaceofretention.ca> Date: Wed, 02 Jun 2010 20:25:36 -0400 From: Vinny User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.5) Gecko/20100103 Thunderbird/3.0 MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <4C06131A.6010107@comclark.com> <20100602082401.GA2876@current.Sisis.de> <4C06169A.9090604@infracaninophile.co.uk> In-Reply-To: <4C06169A.9090604@infracaninophile.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Mailman-Approved-At: Thu, 03 Jun 2010 02:44:14 +0000 Subject: Re: command to strip suffix in .sh script 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: Thu, 03 Jun 2010 00:45:40 -0000 On 06/02/2010 04:30, Matthew Seaman wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 02/06/2010 09:24:01, Matthias Apitz wrote: >> El d=C3=83=C2=ADa Wednesday, June 02, 2010 a las 04:15:22PM +0800, Aiz= a escribi=C3=83=C2=B3: >> >>> I have this code [snip] >> $ echo 'archivename-201006021514.34.tar.gz' | sed 's/-.*$//' > > archive_name=3D${fromarchive%-*} > Thanks Matthew, that's really neat. It took me a long time to find the correct google incantation to find the documentation for that. ( bourne shell pattern-matching notation ) Sure is nice to learn something new everyday.