From owner-freebsd-questions@FreeBSD.ORG Thu Jun 3 17:00:33 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 AA40A1065675 for ; Thu, 3 Jun 2010 17:00:33 +0000 (UTC) (envelope-from freebsd@optimis.net) Received: from mail.optimis.net (mail.optimis.net [69.104.191.124]) by mx1.freebsd.org (Postfix) with ESMTP id 655298FC08 for ; Thu, 3 Jun 2010 17:00:33 +0000 (UTC) Received: from marvin.optimis.net (marvin.optimis.net [192.168.1.3]) by mail.optimis.net (8.14.3/8.14.3) with ESMTP id o53H0WC2020638 for ; Thu, 3 Jun 2010 10:00:32 -0700 (PDT) (envelope-from freebsd@optimis.net) Received: from marvin.optimis.net (localhost [127.0.0.1]) by marvin.optimis.net (8.14.3/8.14.3) with ESMTP id o53H0WIm096208; Thu, 3 Jun 2010 10:00:32 -0700 (PDT) (envelope-from freebsd@optimis.net) Received: (from george@localhost) by marvin.optimis.net (8.14.3/8.14.3/Submit) id o53H0Wpw096207; Thu, 3 Jun 2010 10:00:32 -0700 (PDT) (envelope-from freebsd@optimis.net) Date: Thu, 3 Jun 2010 10:00:32 -0700 From: George Davidovich To: freebsd-questions@freebsd.org Message-ID: <20100603170032.GA95992@marvin.optimis.net> References: <4C06131A.6010107@comclark.com> <20100602082401.GA2876@current.Sisis.de> <4C06169A.9090604@infracaninophile.co.uk> <4C06F680.1000608@palaceofretention.ca> <20100603231116.5e1ef41f@icy.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100603231116.5e1ef41f@icy.localdomain> User-Agent: Mutt/1.5.19 (2009-01-05) 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 17:00:33 -0000 On Thu, Jun 03, 2010 at 11:11:16PM +0700, Anh Ky Huynh wrote: > On Wed, 02 Jun 2010 20:25:36 -0400 Vinny wrote: > > On 06/02/2010 04:30, Matthew Seaman wrote: > > > On 02/06/2010 09:24:01, Matthias Apitz wrote: > > > > Aiza wrote: > > > > > > > > > I have this code > > [snip] > > > > $ echo 'archivename-201006021514.34.tar.gz' | sed 's/-.*$//' > > > > > > archive_name=${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 ) > > In fact I know about that from Bash's documents:) IMHO, there are more > Bash's documents than Bourne's ones. Kids today. ;-) No need for Magick Google Incantations: man sh | less -p 'Parameter Expansion$' man bash | less -p 'Parameter Expansion$' -- George