From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FZEUL-00039r-EA for qemu-devel@nongnu.org; Thu, 27 Apr 2006 17:57:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FZEUK-00039f-39 for qemu-devel@nongnu.org; Thu, 27 Apr 2006 17:57:28 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FZEUJ-00039c-VY for qemu-devel@nongnu.org; Thu, 27 Apr 2006 17:57:28 -0400 Received: from [81.29.64.88] (helo=mail.shareable.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FZEXJ-0001Lj-HN for qemu-devel@nongnu.org; Thu, 27 Apr 2006 18:00:33 -0400 Received: from mail.shareable.org (localhost [127.0.0.1]) by mail.shareable.org (8.12.8/8.12.8) with ESMTP id k3RLvN5h022569 for ; Thu, 27 Apr 2006 22:57:23 +0100 Received: (from jamie@localhost) by mail.shareable.org (8.12.8/8.12.8/Submit) id k3RLvNbi022567 for qemu-devel@nongnu.org; Thu, 27 Apr 2006 22:57:23 +0100 Date: Thu, 27 Apr 2006 22:57:22 +0100 From: Jamie Lokier Subject: Re: [Qemu-devel] patch: configure: nonstandard use of `expr' Message-ID: <20060427215722.GA21384@mail.shareable.org> References: <20060427190105.GA15518@saturn.kn-bremen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060427190105.GA15518@saturn.kn-bremen.de> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Juergen Lock wrote: > At least FreeBSD's expr(1) doesnt understand the syntax now used in > configure: > > Index: qemu/configure > @@ -157,7 +157,7 @@ > fi > > for opt do > - optarg=`expr "$opt" : '[^=]*=\(.*\)'` > + optarg=`echo "$opt" |sed 's/^[^=]*=//'` > case "$opt" in > --help|-h) show_help=yes > ;; The GNU Autoconf manual, and its code, recommends something like this (note the "x" prefix): optarg=`expr "x$opt" : 'x[^=]*=\(.*\)'` Your echo version suffers from non-portable results when opt matches "-n*", "-e*", "-E*", or something with a backslash in. -- Jamie