From owner-freebsd-questions@FreeBSD.ORG Thu Jun 3 16:11:38 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 DCD04106567A for ; Thu, 3 Jun 2010 16:11:38 +0000 (UTC) (envelope-from xkyanh@gmail.com) Received: from mail-pz0-f175.google.com (mail-pz0-f175.google.com [209.85.222.175]) by mx1.freebsd.org (Postfix) with ESMTP id A8B3D8FC15 for ; Thu, 3 Jun 2010 16:11:38 +0000 (UTC) Received: by pzk5 with SMTP id 5so139506pzk.14 for ; Thu, 03 Jun 2010 09:11:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:organization:user-agent :x-operating-system:x-face:face:x-mailer:mime-version:content-type :content-transfer-encoding; bh=T2SD+b/Nx4IuvjVkWln8IeIEHPQ4chgS1VypGMD9P4A=; b=U+XfRKgzJbeEp5YoheOlH5H9GlmwFzfPMTgWYkJ8UWIPHtEkQQpsL3mMiBar07NBh0 Kg6XFTaXG3bQaK/WA+o89h+cBRpzCBqZw2T4FDo3f7s521/RZdslEUs8snzqYDsKGpuW uvqdFC7z55vBflUUxnqwu+cMcjftjurv+1IZk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:user-agent:x-operating-system:x-face:face:x-mailer :mime-version:content-type:content-transfer-encoding; b=uH8+oQw7/8s9k13h3IZ211pNkmwHCF35QlK3AqT/E+ZdEexhj8CLGwVRMoS2GUfjjX jF3FAoXSMZlouYkjQSkH864bmpH3FEIo97FP+mJPFosnHUrCgChnb92AjLoHB+tebzAV CvvZRLQLITf4+6fdR0tOjfcILA5WHJPjuzX9w= Received: by 10.143.177.5 with SMTP id e5mr6805122wfp.304.1275581495855; Thu, 03 Jun 2010 09:11:35 -0700 (PDT) Received: from icy.localdomain ([123.20.12.235]) by mx.google.com with ESMTPS id s21sm187424wff.0.2010.06.03.09.11.33 (version=SSLv3 cipher=RC4-MD5); Thu, 03 Jun 2010 09:11:35 -0700 (PDT) Date: Thu, 3 Jun 2010 23:11:16 +0700 From: "Anh Ky Huynh" To: Vinny 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> Organization: Vietnamese TeX Users Group User-Agent: FreeBSD X-Operating-System: FreeBSD X-Face: FreeBSD Face: FreeBSD X-Mailer: FreeBSD Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-questions@freebsd.org 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 16:11:38 -0000 On Wed, 02 Jun 2010 20:25:36 -0400 Vinny 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