[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] patch: configure: nonstandard use of `expr'

From: Jamie Lokier
Subject: Re: [Qemu-devel] patch: configure: nonstandard use of `expr'
Date: Thu, 27 Apr 2006 22:57:22 +0100
User-agent: Mutt/1.4.1i

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]