Date: Wed, 02 Jun 2010 20:25:36 -0400 From: Vinny <vinny-mail-01+freebsd20100602@palaceofretention.ca> To: freebsd-questions@freebsd.org Subject: Re: command to strip suffix in .sh script Message-ID: <4C06F680.1000608@palaceofretention.ca> In-Reply-To: <4C06169A.9090604@infracaninophile.co.uk> References: <4C06131A.6010107@comclark.com> <20100602082401.GA2876@current.Sisis.de> <4C06169A.9090604@infracaninophile.co.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C06F680.1000608>
