From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Christoph Egger" Subject: Re: Re: "portable" sh is not... Date: Tue, 23 Oct 2007 14:41:26 +0200 Message-ID: <200710231441.26255.Christoph.Egger@amd.com> References: <20071023115443.GA29012@totally.trollied.org.uk> <200710231427.07338.Christoph.Egger@amd.com> <20071023123439.GB30069@totally.trollied.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20071023123439.GB30069@totally.trollied.org.uk> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: John Levon Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Tuesday 23 October 2007 14:34:39 John Levon wrote: > On Tue, Oct 23, 2007 at 02:27:07PM +0200, Christoph Egger wrote: > > On Tuesday 23 October 2007 14:20:14 John Levon wrote: > > > On Tue, Oct 23, 2007 at 02:14:38PM +0200, Christoph Egger wrote: > > > > > http://xenbits.xensource.com/staging/xen-unstable.hg?rev/08295dc1= 31 > > > > >66 > > > > > > > > > > broke our build. The script is not portable as claimed (e.g. > > > > > traditional Bourne shell has no $( ... ) construct). > > > > > > > > The only one bash-specific thing I could find was the [:alpha:] > > > > notion. This changeset makes it work on BSD's /bin/sh. > > > > Looks like BSD's /bin/sh is not that traditional... :) > > > > Looking through get-fields.sh, it seems the $( ... ) constructs can be > > replaced with backticks. This should make Solaris' /bin/sh happy. > > vim is highlighting stuff like > > type=3D${token#COMPAT_HANDLE?} > type=3D${type%?} > type=3D${type#compat_} > > as bad, Does that imply in your case, Solaris' /bin/sh does not support these constructs? > but I don't know what those constructs do.=20 snippet form "man sh": ${name#pattern} ${name##pattern} If pattern matches the beginning of the value of parameter nam= e, the matched text is deleted from the result of substitution. A single `#' results in the shortest match, and two of them resu= lt in the longest match. ${name%pattern} ${name%%pattern} Like ${..#..} substitution, but it deletes from the end of the value. Christoph =2D-=20 AMD Saxony, Dresden, Germany Operating System Research Center Legal Information: AMD Saxony Limited Liability Company & Co. KG Sitz (Gesch=E4ftsanschrift): Wilschdorfer Landstr. 101, 01109 Dresden, Deutschland Registergericht Dresden: HRA 4896 vertretungsberechtigter Komplement=E4r: AMD Saxony LLC (Sitz Wilmington, Delaware, USA) Gesch=E4ftsf=FChrer der AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy