Date: Thu, 3 Jun 2010 23:11:16 +0700 From: "Anh Ky Huynh" <xkyanh@gmail.com> To: Vinny <vinny-mail-01+freebsd20100602@palaceofretention.ca> Cc: freebsd-questions@freebsd.org Subject: Re: command to strip suffix in .sh script Message-ID: <20100603231116.5e1ef41f@icy.localdomain> In-Reply-To: <4C06F680.1000608@palaceofretention.ca> References: <4C06131A.6010107@comclark.com> <20100602082401.GA2876@current.Sisis.de> <4C06169A.9090604@infracaninophile.co.uk> <4C06F680.1000608@palaceofretention.ca>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 02 Jun 2010 20:25:36 -0400 Vinny <vinny-mail-01+freebsd20100602@palaceofretention.ca> wrote: > 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, Aiza > >> escribi=C3=83=C2=B3: > >> > >>> I have this code > [snip] > >> $ echo 'archivename-201006021514.34.tar.gz' | sed 's/-.*$//' > > > > archive_name=3D${fromarchive%-*} > > >=20 > 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. Cheers, --=20 Anh Ky Huynh
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100603231116.5e1ef41f>